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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Rename Column by value of first row (power query editor)

Hi,

 

in my example I want to rename Column2 with the value of the first row of Column 1:

 

  • Column 1
    • Value X
    • Value Y
  • Column 2
    • Value AB
    • Value CD

Shoud be changed to

 

 

  • Column 1
    • Value X
    • Value Y
  • Value X
    • Value AB
    • Value CD

How can I manage to do that with Excel Power Query Editor?

 

Thanks for your help.

 

2 ACCEPTED SOLUTIONS
AlexisOlson
Super User
Super User

Do a rename column step and use the first row of Column1 as the value to rename.

 

= Table.RenameColumns(#"Previous Step Name",{{"Column2", #"Previous Step Name"[Column1]{0}}})

View solution in original post

Anonymous
Not applicable

Many thanks. That worked.

View solution in original post

3 REPLIES 3
AlexisOlson
Super User
Super User

Do a rename column step and use the first row of Column1 as the value to rename.

 

= Table.RenameColumns(#"Previous Step Name",{{"Column2", #"Previous Step Name"[Column1]{0}}})
Anonymous
Not applicable

Many thanks. That worked.

Just FYI, you marked your last comment as the solution. Might be confusing for future readers.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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