Forum Discussion
Column name doesn’t update in subsequent Power Query steps
Hello,
I’ve written a many-step query, and now I want to rename a column from an early step. When I do, any subsequent steps that reference this column break. I’m surprised that it doesn’t update the name everywhere it is used after the change. Is there a quick way to "Find and Replace All" instances of a column name? Right now I’m copy-pasting to a notepad, performing the replacement, then copy-pasting the M code back into the Advanced Editor. Not a big deal, it just seems extra.
Thanks, JO
4 Replies
- AnonymousNot applicable
Hi olander ,
Please try to get the column names firstly, then by the index to get the name and use the name in the next M function.
For more details, you can read related document: Table.ColumnNames - PowerQuery M | Microsoft Learn
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- olanderFrequent Visitor
That doesn’t qualify as a "quick way to 'Find and Replace All'." So you are saying that no such functionality exists in Power Query for updating string literal column names quickly?
- AnonymousNot applicable
Hi olander ,
Please try Table.RenameColumns().
For more details, you can read related document: Table.RenameColumns - PowerQuery M | Microsoft Learn
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.