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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
MasterSonic
Helper IV
Helper IV

Replace column names

Hello,

Is there a way to bull change column names in table1

 

I have a Excel file with old->new names key.

It can be loaded as NewName column in table2

 

Is there way to do it?

Something like

 transformcolumnnames. Text.replace

for many columns at once.

 

 

 

 

 

1 ACCEPTED SOLUTION
PaulOlding
Solution Sage
Solution Sage

Hi @MasterSonic 

You may get a better answer than this in the Power Query forum, but here's something I've used to do this:

Table.TransformColumnNames(#"Previous Step", each if List.PositionOf(column_name_table[OldName], _) = -1 then _ else column_name_table[NewName]{List.PositionOf(column_name_table[OldName], _)} )

View solution in original post

2 REPLIES 2
PaulOlding
Solution Sage
Solution Sage

Hi @MasterSonic 

You may get a better answer than this in the Power Query forum, but here's something I've used to do this:

Table.TransformColumnNames(#"Previous Step", each if List.PositionOf(column_name_table[OldName], _) = -1 then _ else column_name_table[NewName]{List.PositionOf(column_name_table[OldName], _)} )

works like a charm

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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