Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Changes in column name affecting subsequent Power Query steps

Hi guys, 

 

i have a recurring problem. I have a table in Power Query and a lot of transformations on that table. 

 

Now sometimes it happens that a column name changes in the original table or that i need to change a column name for better understanding. 

 

Now all subsequent steps where the column name is refferred to have to be updated for the new name. Is there an efficient way to do it for alle subsqeuent steps at once?

 

Thanks guys

1 ACCEPTED SOLUTION
Jimmy801
Community Champion
Community Champion

Hello @Anonymous 

 

you can copy paste the code into some editor and replacing your column-references at once.

 

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

View solution in original post

3 REPLIES 3
Jimmy801
Community Champion
Community Champion

Hello @Anonymous 

 

you can copy paste the code into some editor and replacing your column-references at once.

 

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

CNENFRNL
Community Champion
Community Champion

@Anonymous , I'm afraid you have to manually change those hard-coded column names one by one; but a more generic reference to the name of a certain column,

Table.ColumnNames(#"Some Step"){1}

renders your M code more flexible; so when you change a column's name next time, you don't need to adjust the M code again.


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

analyticsnags
Regular Visitor

In such scenerios you can create a view in database and use the view in Power Query. So whenever the changes in table , you can change the names in View. If the Power bi desktop you need to new name then at the end of power query step you can rename.

 

This is how we managed in some projects.

 

 

If you donot have control on database, write sql query to extract data from table so that use alias name.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors