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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
saipawar
Helper IV
Helper IV

Transpose multiple header rows into columns

peersnap.PNG

Is there any way to break out the top 3 rows of headers into columns such that they are correctly mapped to each other?

 

Thanks

5 REPLIES 5
dax
Community Support
Community Support

Hi @saipawar ,

The image in your post seems to be visual(Matrix) instead of data structure, if you want to transform your data structure, could you please inform me your current data structure in table and your expected output? Then I will test this in my environment.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

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

Hi @saipawar ,

I created a function for such a requirement here: https://www.thebiccountant.com/2017/06/19/unpivot-by-number-of-columns-and-rows-in-powerbi-and-power...

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Nishantjain
Continued Contributor
Continued Contributor

@saipawar  I agree with  @mhossain suggestion to clean the data in the spreadsheet if possible. 

But I also agree that this is not possible in all cases in the real world as I have encountered this myself many times. 

 

The link below has the solution. Any questions let me know 

 

https://drive.google.com/file/d/1YJ612X31VbJ0qL-ADogxFr7aekiYOFnQ/view?usp=sharing 

 

Thanks

Nishant

 

Greg_Deckler
Super User
Super User

@ImkeF 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
mhossain
Solution Sage
Solution Sage

Hi @saipawar 

 

So basically you want to achieve below structure

RatingCompanyProduct Category

Product

 

 

Definately doable in powerquery but I would suggest why don't you clean excel little bit so that you don't have to do so much calculation/cleaning in the powerquery. Initial cleaning in excel I think will be quick then you can go to powequery and structure/unpivot etc. Just a suggestion. Or you have something else in mind, share some more details.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.