Forum Discussion
Unpivoting with Multi-Header Columns
Hello,
I am trying to unpivot a data set that has multiple headers. When I promote the headers to the one I want, I lose the details and no longer know what that header value pertains to since the header names repeat across the columns for multiple stats. Here's an example of what the raw data set looks like:
This is what I want the desired state to look like:
When I promote the headers before I unpivot, then my data set looks like this at which point I don't know what metrics/stats the columns pertain to (ie. the first two have to do with Avg Audience (000) and the second two relate to Dly Rch (000):
The second issue is if I unpivot how do I get 3 columns with the Daypart info, Avg Audience, and Dly Rch columns?
Thanks in advance for your help!
Hi Anonymous ,
You can try copying the M Query in the file below into the Advanced Editor:
Here is a demo, please try it:
Best Regards,
Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
5 Replies
- mwegenerMost Valuable Professional
Hi Anonymous ,
could you share you sample data as Excel?
Regards,
Marcus
Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.- AnonymousNot applicable
Hi Marcus,
It looks like I can't attach files to this thread unfortunately!
Member123456 - could you please look into adding this very basic functionality?
- v-joesh-msftSolution Sage
Hi Anonymous ,
You can try copying the M Query in the file below into the Advanced Editor:
Here is a demo, please try it:
Best Regards,
Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Ashish_MathurSuper User
Hi,
See if my solution helps - Rearrange a multi heading dataset into a single heading one which is Pivot ready.
Hope this helps.