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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors