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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors