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
kylekumm
New Member

Promote specific row to header

Hi, 

 

I am working on a learning project and am in the process of cleaning the data. How would I make a specific row the header, as opposed to the first row? In this case, I would like row 18 to be the header row. Any help would be much appreciated!

Row Query.png

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

This M code replace the header with the entries in row 3 of the table

let
    Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
    Colheaders = List.Zip({Table.ColumnNames(Source),Record.ToList(Source{2})}),
    Originaltable = Source,
    #"Renamed Columns" = Table.RenameColumns(Originaltable,Colheaders),
    #"Filtered Rows" = Table.SelectRows(#"Renamed Columns", each ([Name] <> "Name"))
in
    #"Filtered Rows"

Ashish_Mathur_0-1697889207247.pngAshish_Mathur_1-1697889215644.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ahmedx
Super User
Super User

what should I do with the lines above line 18, delete them?

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.