Excel Power Query Rename Columns: Step-by-Step Guide
In this article
To rename columns in Excel Power Query, open the Power Query Editor, double-click the column header you want to change, type the new name, and press Enter. That is the quickest method. For multiple columns at once, select them with Ctrl+click, then right-click and choose Rename. You can also use the Advanced Editor to edit the M code directly, or use a transformation table to apply consistent names. This guide walks through each method, plus how to avoid common pitfalls like broken steps and case-sensitivity issues.
What You'll Need
- Excel 2016 or later (Power Query is built in as Get & Transform Data on the Data tab). In Excel 2010 and 2013, Power Query is a separate add-in from Microsoft.
- A data source already loaded into Power Query (from a table, CSV, database, or web).
- Basic familiarity with the Power Query Editor window and the Applied Steps pane.
Menu labels can differ slightly by Excel version, region, and whether you are on Windows or Mac. The steps below refer to the Windows desktop version; the Mac version has a similar but not identical ribbon.
Step-by-Step
- Open the Power Query Editor. Select any cell in your data table, then go to Data > From Table/Range (or the equivalent option for your source). If the query is already loaded, go to Data > Queries & Connections, then double-click the query to open it in the editor.
- Locate the column to rename. The editor shows a preview of your data with column headers at the top. Scroll horizontally if needed.
- Rename a single column by double-clicking. Double-click the column header, type the new name, and press Enter. The header updates immediately and a new step appears in the Applied Steps pane on the right.
- Rename using the right-click menu. Right-click the column header and choose Rename. Type the new name and press Enter. This is useful if double-click is awkward on your device.
- Rename multiple columns at once. Hold Ctrl and click each column header you want to rename. Right-click one of the selected headers and choose Rename. Type a name and press Enter. Power Query applies the same name pattern to all selected columns (for example, Column1, Column2), which you can then adjust individually.
- Rename using a transformation table (optional). If you rename columns often, create a small two-column table in Excel with old names and new names. In Power Query, use Home > Advanced Editor to add a step that references this table and applies the renames. This is more advanced and requires M code knowledge.
- Check the Applied Steps pane. Each rename creates a step named Renamed Column. You can click any step to see the data at that point. If a rename was a mistake, delete the step by clicking the X next to it.
- Close and load. When finished, go to Home > Close & Load (or Close & Load To to choose where the data goes). The renamed columns appear in your worksheet or data model.
Common Mistakes
- Renaming a column that a later step depends on. If a subsequent step references the old column name (for example, a filter or a calculated column), renaming will break that step. Check the Applied Steps pane for errors after renaming.
- Using duplicate names. Power Query does not allow two columns with the same name in the same query. If you try, it will append a number or show an error.
- Case sensitivity. Power Query treats column names as case-sensitive in some operations. Renaming "Sales" to "sales" may cause downstream steps to fail if they reference the original case.
- Renaming in the worksheet instead of the editor. Changing headers in the Excel table does not change them in Power Query. Always rename inside the Power Query Editor.
- Forgetting to refresh. After renaming, if the query is loaded to a worksheet, you may need to refresh (Data > Refresh All) for changes to appear.
Tips
- Use descriptive names without spaces or special characters to make later steps easier to write and read.
- Rename columns as early as possible in the query, before adding complex transformations, to reduce breakage.
- If you need to rename many columns systematically, consider using the "Use first row as headers" option if your data has a header row, rather than renaming manually.
- Keep the Applied Steps pane visible; it is your undo history and debugging tool.
- When sharing queries, document your column names in a separate sheet so others understand the structure.
Troubleshooting
If a rename does not work or causes errors, try these steps in order:
- Check for error indicators. A red error icon may appear on the step or in the data preview. Click the step to see the error message.
- Undo the rename. Delete the Renamed Column step in the Applied Steps pane, or press Ctrl+Z immediately after renaming.
- Verify column references. If a later step fails, edit that step (click the gear icon next to it) and update the column name it references.
- Refresh the preview. Go to Home > Refresh Preview to reload the data and clear temporary glitches.
- Close without saving and reopen. If the editor becomes unresponsive, close it (Home > Close & Load will save changes; use File > Discard & Close if you want to abandon changes) and reopen the query.
- Recreate the query. As a last resort, delete the query and start fresh, being careful to rename columns before adding other steps.
If the issue persists, check that your data source is still accessible and that the column you are renaming actually exists in the source. Renaming a column that was removed by an earlier step will fail.
Frequently Asked Questions
Can I rename a column in Power Query without affecting the original data source?
Yes. Renaming in Power Query only changes the query output, not the source file or database. The original data remains unchanged.
How do I rename a column that has no header?
If your data has no headers, Power Query assigns generic names like Column1, Column2. You can rename these directly. Alternatively, use Home > Use First Row as Headers if the first row contains names.
Why does my rename step show an error?
Common causes are a duplicate name, a name that conflicts with a later step, or a column that no longer exists because an earlier step removed it. Check the Applied Steps pane and the error message for details.
Can I rename columns using a formula or dynamically?
Power Query does not have a simple formula for renaming. You can use the Advanced Editor to write M code that renames columns based on a list or table, but this requires programming knowledge.
Does renaming a column break my pivot table or chart?
If the pivot table or chart is based on the query output, renaming a column may break references. You will need to update the pivot table or chart to use the new name. Refresh the query after renaming to see the change.
Is there a limit to how many columns I can rename at once?
No specific limit, but renaming many columns at once can make the query harder to maintain. It is often better to rename in small batches and test after each change.