Forum Discussion
Unpivot multiple columns
How to convert from yellow to blue with Transformation Ribbon (With Power Query I could)
You can find data-source here at sheet 3 > Multiple Level Unpivoting.xlsx (sharepoint.com)
Regards,
Ritesh
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
https://1drv.ms/u/s!AiUZ0Ws7G26RiXEg4g_GHXMj4dcz?e=lUntf5
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
4 Replies
- amitchandakSuper User
ribisht17 Try this code in a blank query of power query
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTIyBhJ+IJahgQGQjEwthpN++UqxOtFKTiBJmCpTU+yKnIFMMzMgYQJSYGGOpgpExsYCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [EMP = _t, #"Power BI Score" = _t, #"Sigma Score" = _t, #"Tableau Score" = _t, #"Tableau Certification" = _t, #"Power BI Certification" = _t, #"Sigma Certification" = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"EMP", type text}, {"Power BI Score", Int64.Type}, {"Sigma Score", type text}, {"Tableau Score", Int64.Type}, {"Tableau Certification", type text}, {"Power BI Certification", type text}, {"Sigma Certification", type text}}), #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"EMP"}, "Attribute", "Value"), #"Split Column by Delimiter" = Table.SplitColumn(#"Unpivoted Columns", "Attribute", Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, true), {"Attribute.1", "Attribute.2"}), #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Attribute.1", type text}, {"Attribute.2", type text}}), #"Pivoted Column" = Table.Pivot(#"Changed Type1", List.Distinct(#"Changed Type1"[Attribute.2]), "Attribute.2", "Value") in #"Pivoted Column" - ribisht17Super User
Thanks Amit, Can you share the pbix file with me ?
Are you getting the above desired output with this code ?
I wanted to do this with transformation ribbon not Power Query , I did try to follow your code but could not get the desired output
Regards,
Ritesh
- AhmedxSuper User
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
https://1drv.ms/u/s!AiUZ0Ws7G26RiXEg4g_GHXMj4dcz?e=lUntf5
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
- ribisht17Super User
Thanks Ahmedx and amitchandak it helped!