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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Dynamically changing multiple column names in Power Query

Hi,

 

I have a data source(Excel) where it has columns as below, 

Region   category  Sales

A               X             100

B                Y             200

after conencting to dats source I have changed the column names and data in data source(Excel file)

Country   Product     Forecast Sales

A               X               100

B               Y                200

C               Z                300

when i refresh the source it thrown me error that column names not found.

I know work around to change column name dynamically by adding M code in query editor but it needs to mention for every column . assume if I have 10 columns and changing 5 columns it should have 5 line extra code to rename columns .

Is there any better way that power bi handles changing column names dynamically ?

it should be basic feature because most of the visualization tolls handle it with out changing code ex like Spotfire, tableau detect by default and give an option to choose column or replace columns with new columns.

 

A quick help would be appreciated.

1 REPLY 1
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

When you open an excel file, you can click  edit option to enter query editor. Then you need to find “Changed Type” in the APPLIED STEPS and delete it. Then click Close & Apply. This table’s column names can be dynamic when you update your excel files.

 

Best Regards,

Eads

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.