Key insights
- Power Query editor
Microsoft still treats column renames as a standard transform in the Power Query editor. Use the UI to rename or edit the M formula when you want a simple, manual change.
- Table.RenameColumns
A common hard-coded step is Table.RenameColumns(Source, {{"OldName","NewName"}}). That breaks if the source column name changes, so avoid embedding fixed old names when possible.
- Table.ColumnNames + List.Zip
Build a rename list from the current table’s column names and a target list, then pair them with List.Zip and apply Table.RenameColumns to rename dynamically.
- mapping table
Keep an external mapping table with OldColumn and NewColumn values to apply renames centrally. This makes renames reusable and easier to update across queries.
- MissingField.Ignore
Use MissingField.Ignore when applying renames so the query won’t fail if a source column is missing or already renamed. It improves resilience for changing schemas.
- dynamic M code
For durable solutions, write dynamic M code instead of hard-coding names: open the editor, derive current column names, build the rename mapping, and apply it. I can provide copy-paste M examples for general use, Power BI, or mapping-table approaches if you want.
Keywords
Power Query rename column, rename column dynamically Power Query, M language rename column, Power BI rename column without referencing, rename column by position Power Query, Power Query change column name without reference, Power Query dynamic column renaming, Power Query rename columns programmatically