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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
twister8889
Helper V
Helper V

Load and transformation from excel with merged cells to table into power bi

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:

 

ETL excel pb.png

 

1 ACCEPTED 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

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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)

ETL excel pb_v1.png

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors