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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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?

 

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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