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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Solution Authors
Top Kudoed Authors