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
Rygar
Helper II
Helper II

Naming existing Columns 1 to N

Hello!

 

for Example, in a six Column table I would like to name these Columns from 1 to 6 or from c1 to c6 or something like that.

I can not use rename (old name=>new name), because I have multiple tables with totaly different Column names. But the order of the columns is always same (date, product, price, ... ....) 

My goal is to append all the tables together.

 

My Question: can I Name (not rename) columns by Numers 1 to N or by using a predefined List of Names or something else?

 

Thanks, Michael

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

I think you can do a dynamic rename using Table.ColumnNames.

 

For example,

let
    Source = Table.FromRows({{"a","b","c","d","e"}}),
    CurrentColumnNames = Table.ColumnNames(Source),
    NewColumnNames = List.Transform({1..List.Count(CurrentColumnNames)}, Number.ToText),
    #"Renamed Columns" = Table.RenameColumns(Source, List.Zip({CurrentColumnNames, NewColumnNames}))
in
    #"Renamed Columns"

View solution in original post

2 REPLIES 2
Rygar
Helper II
Helper II

Really good, thanks a lot!

AlexisOlson
Super User
Super User

I think you can do a dynamic rename using Table.ColumnNames.

 

For example,

let
    Source = Table.FromRows({{"a","b","c","d","e"}}),
    CurrentColumnNames = Table.ColumnNames(Source),
    NewColumnNames = List.Transform({1..List.Count(CurrentColumnNames)}, Number.ToText),
    #"Renamed Columns" = Table.RenameColumns(Source, List.Zip({CurrentColumnNames, NewColumnNames}))
in
    #"Renamed Columns"

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.