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

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
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.