Forum Discussion
DCSupport
7 years agoRegular Visitor
How to unpivot table with multiple nested columns?
Hi We have this data that needs to unpivot however it has another layer at the top. See the example below: Vendor 1 Vendor 2 Vendor 3 Req Key Value 1 Calcul...
v-juanli-msft
7 years agoCommunity Support
Hi DCSupport
First, Promoted Headers to get the following
Rename columns by adding "Vendor 1", "Vendor 2","Vendor 3"
Then select "Req Key" and "Value 1" columns, "Unpivot other columns",
Next, Split columns by delemiter "_",
Finally, unpivot the Attribute.2 column.
You could find detailed steps in my pbix.
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ImkeF
7 years agoCommunity Champion
Hi DCSupport ,
if you number of vendors is dynamic, you might prefer this fully dynamic solution intead: https://www.thebiccountant.com/2017/06/19/unpivot-by-number-of-columns-and-rows-in-powerbi-and-powerquery-in-excel/
Please check out the enclosed file.