Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello, guys
I would like to transform my excel data, into a power query, to present my data as a table without merged cells. How can do I do my data stay by column?
I think that result with power query, is like table 3 in the image below:
Solved! Go to Solution.
Hi @twister8889 ,
try to demote the header first before applying my function.
So that the rows to unpivot are actually the first 3 rows in the table and not one of them a table header.
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
@twister8889 , You can unpivot on a level easily in power bi
https://radacad.com/pivot-and-unpivot-with-power-bi
@ImkeF , can you help on this
Hi @twister8889
the link provided above will not solve your problem.
If you want to unpivot multiple header rows, you can use the function I've created here: https://www.thebiccountant.com/2017/06/19/unpivot-by-number-of-columns-and-rows-in-powerbi-and-power...
For your example here, the second parameter has to be a 1 (one column to keep) and the third parameter a 3 ( 3 header rows to unpivot )
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
First of all, thank you for your answer
I have the follow results,
1) using the unpivot
- To the country column, ok, but I still have a problem with other columns.
2) Using the unpivot by number of columns
- I lost countries data (C1, C2)
Hi @twister8889 ,
try to demote the header first before applying my function.
So that the rows to unpivot are actually the first 3 rows in the table and not one of them a table header.
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
Hi there, is there a video on how to do this? I am new to PBI and am struggling to do the first step. Thank you
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.