Forum Discussion
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.
Any Ideas?
7 Replies
- MariuszCommunity 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- StuartSmithPower Participant
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.
- amitchandakSuper 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?
- ImkeFCommunity Champion
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-powerquery-in-excel/
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-p/963216
- StuartSmithPower Participant
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,
- MariuszCommunity 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