Forum Discussion
Unpivot multiple headers in a data (header has merged cells)
Hi Experts,
I am trying to unpivot this set of data that has 2 headers. (my 1st row's headers has merged cells.)
When I inport to power query it looks like this.
I've tried transpose and unpivot but it doesnt seems to work. Looked around other post but cannot find a solution for my case.
Please help if you have the solution for me.
Thank you.
I changed my "as of" to dates, created a calendar table and the linked them up in a relationship.
Created a month column in my date table and result is as follow:
4 Replies
- visheshjain
Impactful Individual
Hi Yuiitsu,
Please can you share some sample data and your required output.
Tranpose and fill down should have worked.
Its one of the things taught in the MS PBI tutorial videos and your problem does look similar.
Thank you,
Vishesh Jain
- Yuiitsu
Helper V
HI!
I actually managed to work around with transpose and fill down and get the below result:
But i now face another issue, I want it to show from As of Oct, As of Nov, As of Dec instead of by alphabetical order. Can you assist me with that?
Oct-22 Nov-22 Dec-22 Jan-23 Feb-23 Mar-23 Type Customer Product Actual Actual As of Oct As of Nov As of Dec As of Nov As of Dec As of Nov As of Dec As of Dec BOH GX3 All Others IME 3DI+CT 18,000,000 18,000,000 Others MSE CT Others MSE SD BOH MSE SPS 9,704,100 BOH UMC All 15,000,000 BOE SDSM TS 135,411,155 BOH MSE CT/SD 4,224,726 BOE AMF CT Others SO TPS 4,000,000 4,000,000 Others UMC TPS 21,000,000 21,000,000 EOS Intend 5 TS Others TF TS 3,200,000 BOH 360 ES/P5 Others Terra CT 4,759,200 4,759,200 4,759,200 Others AMF CT 8,000,000 1,500,000 1,500,000 BOE UMC CT 3,237,675 3,237,675 BOE UMC CT 7,329,605 7,329,605 BOE STM TPS 6,000,000 BOH GX3 PVD 5,000,000 Others UMC CT 31,500,000 31,500,000 Others UMC SPS 15,000,000 15,000,000 BOH Lum CT 2,939,720 2,500,000 BOH GX3 All 28,000,000 28,000,000 BOH Intend TS 1,414,560 BOE UMC CT 11,000,000 - visheshjain
Impactful Individual
Hi Yuiitsu,
Ideally you should be using a calendar dimesnion table for it, create realtionship between the 2 tables after converting your months into the first date of that month in your fact table.
Your calendar table should have the MMM-YY column, which is sorted by the Year Month Key column and use that in your visuals.
So in your calendar table, Oct-22 will have a corresponding numeric value 202210.
Hope this solves your issue.
Thank you,
Vishesh Jain