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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
lalithab
New Member

transform sub heading in power query

Unable to transform sub data in powerquery 

 

5 REPLIES 5
lalithab
New Member

lalithab_0-1689324269576.png

 

 

I have a data like this with sub headings in a single sheet, i need to have them in PQ to sumarize how to convert the sub heading into a column

 

Hi, @lalithab 

 

Did you checked the solution I provided? 

 

Did it helped in any way? If yes, appreciate the kudos. 👍

if you find my reply helpful, accept this answer as solution. 

 

thanks


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


@lalithab 

let
    Source = Excel.Workbook(File.Contents("full_path_to_file"), null, true),
    Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
    #"Filtered Rows" = Table.SelectRows(Sheet1_Sheet, each ([Column2] <> null)),
    #"Promoted Headers" = Table.PromoteHeaders(#"Filtered Rows", [PromoteAllScalars=true]),
    #"Filtered Rows1" = Table.SelectRows(#"Promoted Headers", each ([Category] <> "Category"))
in
    #"Filtered Rows1"

Well, below are the steps that you might want to follow to achieve your goal. 

1. From the Data tab select "From table/Range" (assuming you've got the Excel sheet open)
2. Power Query window will be opened, now select the column that has the subheading, and from "Transform Tab" click "Unpivot" 
3. Now use "Use first row as header" option and then rename the "Attribute" column to a proper name. 

I am adding a GIF for your better understanding. 

Subheader to column.gif

Follow same technique for the rest of your subheader in the sheet and then use "Append" queries to append the tables as your table structure is same. 

Let me know if you have any further questions. 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.    


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


rubayatyasmin
Community Champion
Community Champion

Hi, @lalithab 

Can you be more specific or share a screenshot if possible? 


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.