Forum Discussion
Moving Rows into columns with Unique ID
- Anonymous2 years ago
Hi Anonymous ,
Thanks for amitchandak reply.
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:Click "Transform data" and open power query
Select the Title column and select the pivot column in the Transform toolbar, then in the screen that opens select Status in the value column and select the Don't Aggregate option in the Aggregate Value function.Select the Title column and select the pivot column in the Transform toolbar, then in the screen that opens select Status in the value column and select the Don't Aggregate option in the Aggregate Value function.Final output
You can also use this m code in advanced editor
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("lZCxDsIgEIZfpWHuIvgC2g420cZYt6bDWS9KpGCAmvj2QtKhQAe7/Lk7/v/ycW1LrtwKJDk5ImiJOqvKWVPD4N8aC3Y0rij5hxuuJOnylhRq1AazjZtXpde9ujkt1PAWaPHu6jN8tRIitVO/FTQ8o8DhknqZ053gPUbeBgSa1L51egL98o3sJ/80Q8vlYx6hEXyQWKCnCX2QCPFpgh+YE34a889/u4jP1t2erbg9WwnP/oTvfg==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"(blank)" = _t, #"(blank).1" = _t, #"(blank).2" = _t, #"(blank).3" = _t, #"(blank).4" = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"(blank)", type text}, {"(blank).1", type text}, {"(blank).2", type text}, {"(blank).3", type text}, {"(blank).4", type text}}), #"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]), #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Title", type text}, {"Learner ID", type text}, {"Learner Name", type text}, {"Status", type text}, {"Division", type text}}), #"Pivoted Column" = Table.Pivot(#"Changed Type1", List.Distinct(#"Changed Type1"[Title]), "Title", "Status") in #"Pivoted Column"Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Anonymous , Unpivot should help in this case
Unpivot Data(Power Query): https://youtu.be/2HjkBtxSM0g
Learn Power BI: Power Query Table.Unpivot, Table.UnpivotOtherColumns: https://youtu.be/0FEGEAz9UMw
- Anonymous2 years agoNot applicable
Unpivot seems to be putting data in rows rather than columns.
I want the row to group all courses in columns with the one unique ID.
To this:
Learner ID Learner Name Course 1 Course 2 Course 3 Division