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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
AleksandrMe
Resolver I
Resolver I

Data Query Source Change

Good day, 

 

I have a Power Bi Dataset which is extracting data from number of excel files, similar files from different sources. I have changed names of some columns in source file, but structure is the same. 

Is there a way to write a line in Advanced editor or similar to keep updating data considering old and new names of same columns?!

 

THnaks

Aleks 

1 ACCEPTED SOLUTION
Jimmy801
Community Champion
Community Champion

Hello @AleksandrMe 

 

once you merge two tables, the trigger is the column name. So to avoid problems here you have to find a logic to rename your columns before merging. If you have a rigid structure you could create list of the new columns names then apply a RenameColumns-functions that is considering the old names and your new list and nename them.

Another approach could be to create a table with two columns (old and new) and use this information to rename the columns. When using this approach you probably have to filter the table that you use before applying the renaming (that the old-column contains only values that in the table to be renamed are in)


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

1 REPLY 1
Jimmy801
Community Champion
Community Champion

Hello @AleksandrMe 

 

once you merge two tables, the trigger is the column name. So to avoid problems here you have to find a logic to rename your columns before merging. If you have a rigid structure you could create list of the new columns names then apply a RenameColumns-functions that is considering the old names and your new list and nename them.

Another approach could be to create a table with two columns (old and new) and use this information to rename the columns. When using this approach you probably have to filter the table that you use before applying the renaming (that the old-column contains only values that in the table to be renamed are in)


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

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.