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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
StuartSmith
Power Participant
Power Participant

Sub-Headers in Excel File Data Source

I have an excel data source that has a header and then a sub-header and unsure how to handle it without maybe removing the month header and just sticking with the CW (Calendar Week) Header, although this isnt my data source.

 

Sub-Header.png

 

Any Ideas?

7 REPLIES 7
Mariusz
Community Champion
Community Champion

Hi @StuartSmith 

 

Please see the attached file with the transformation applied, please follow the steps in Power Query Editor, 

Any questions please let me know.

 


Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

amitchandak
Super User
Super User

You have an unpivot option but two-level will not help.

https://radacad.com/pivot-and-unpivot-with-power-bi

 

@ImkeF , can you help?

 

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 @StuartSmith  

please check the function I made for this task here: https://www.thebiccountant.com/2017/06/19/unpivot-by-number-of-columns-and-rows-in-powerbi-and-power... 

 

Also, here is some guidelines on how to attach sample data in this forum: https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-... 

 

 

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

@ImkeF that looks ideal for my data, one problem, How do i ge the code in to Power BI. I have been searching\googling, but know the code must go into the "Advanced Editor", but when I open Avacned Editor, there is already some code there, so I pasted your code below, but that errors.  

 

I have watched lots of youtube clips, but again, not much help.

 

Thanks,

@ImkeF  Ignore my last comment as figured it out.

Mariusz
Community Champion
Community Champion

Hi @StuartSmith 

 

You can do some Power Query Transformation and keep both if that's what you after?

If you need some help, please provide the data sample is useable format ( something that can be imported or pasted ) into the Power Query Editor

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Thanks,  I have hoping to attach the file, but no option for that. I have tried posting the table from Excel, but it keeps on failing.  Sorry to be a pain, whats the best we to get you the table example.

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.