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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
ExposedAnkles
New Member

How to use a mid-table row as the column headers, while still keeping the above table rows

Good day everyone!

 

I am relatively new to Power Bi Desktop and am hoping for answers to my current problem.

 

I've imported data from an Excel Workbook and am now trying to format my data. I've notice that the row I'd like to use as column headers is in the middle of the table and currently I am unsure how to use that row without losing the data entries above it.

 

Logically, I've deduced that a possible solution would be to delete the row and then to manually rename the column headers myself, but is there not a more dynamically way to do things?

9 REPLIES 9
Idrissshatila
Super User
Super User

Hello @ExposedAnkles ,

 

you can use the following to make a random row as header by referencing the number of row and instead of source you reference the previous step if it wasn't the source step

 

#"Promoted Headers" = Table.PromoteHeaders(Table.Skip(Source,1), [PromoteAllScalars=true])



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Haven't resolved it yet and have an idea of what you're hinting at, but could you please explain these steps in abit more detail again

@ExposedAnkles Can you show me the advanced editor in the table you want to adjust the headers and the number of row you want to make the header.

Idrissshatila_0-1698135462480.png

 

copy past here the code in the advanced editor to here

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




ExposedAnkles_0-1698135976229.png

 

@ExposedAnkles ,

 

in the last row after the "in" replace the #"Changed Type"  with #"Promoted Headers"



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




ExposedAnkles_0-1698137708245.png

 

No dice, unfortunately.

@ExposedAnkles , replace the promoted header line with this

 

#"Promoted Headers" = Table.PromoteHeaders(Table.Skip(#"Changed Type",1), [PromoteAllScalars=true])



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




ExposedAnkles_0-1698139810423.png

 

This works, but unfortunately, I've lost some of the data

HughLa
Resolver IV
Resolver IV

Hi @ExposedAnkles 

 

In the Power Query editor, you should promote the first row to headers after you imported the data.

HughLa_0-1698133415471.png

 

Hope this helps you.

Hugh

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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