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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.