Forum Discussion
Unpivot/Pivotting Table
Hi All
need assistance with pivotting/unpivotting a table via powerbi desktop
i have date output in powerbi similar to this structure below
i have unpivoted other columns when selecting the Name column, and that gets me to an output of below, but not quite what i am wanting. ive tried other ways and i am not sure i started in the right way and need some guidance if possible
the output structure i am trying to achieve iswhat i am trying to do is merge or pivot/unpivot tables so that to end result starts to look this
thanks for helping
4 Replies
- amitchandakSuper User
Anonymous , After the unpivot, Create a new column with value: Only Date and Product and Pivot it.
One example
Type = Text.Start([Attribute],4)
Also check if needed
https://kohera.be/blog/power-bi/how-to-unpivot-twice/
- AnonymousNot applicable
thanks amitchandak
when i follow the document and your scenario i get errors
when i pivot table, i am highlighting just the new custom column (which has Date and Prod) and i pivot on that. ensuring "Dont aggregate" is set in advance options
from there i have the right structure but the cells in both Date and Prod have an errorive blanked out the name but what am i missing?
could it be that due to the Value column has multiple values that are the same? then do i need add an index of sorts?
- anitha_santhanRegular Visitor
I am not sure if this works. But , please try .
First unpivot all date columns
Then on the next step unpivot all product columns
- AnonymousNot applicable
thanks
that works somewhat, but even in your example...what it does it duplicate values across dates.
there should only be 1 reference of a date and product for each person (for each date)