Forum Discussion
Turn rows into columns
- 5 years ago
Hi annag815
Download PBIX file with solution
In the Power Query Editor (click on Transform data in the PBI Ribbon) , select the Question and Answer columns then select Pivot Column from the Transform tab
In the Pivot Column dialog box choose Answer as the Value column and in Advanced options set the aggregate type to Don't Aggregate
Which gives this result
Here's the code which is in the PBIX file I linked to above
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUQrUg5IKjnnF5alFSrE6MAkjCIkpYQwhkSWMcBllhMsoI6xGxQIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Inspection = _t, Question = _t, Answer = _t]), #"Pivoted Column" = Table.Pivot(Source, List.Distinct(Source[Question]), "Question", "Answer") in #"Pivoted Column"Regards
Phil
Hi annag815
Download PBIX file with solution
In the Power Query Editor (click on Transform data in the PBI Ribbon) , select the Question and Answer columns then select Pivot Column from the Transform tab
In the Pivot Column dialog box choose Answer as the Value column and in Advanced options set the aggregate type to Don't Aggregate
Which gives this result
Here's the code which is in the PBIX file I linked to above
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUQrUg5IKjnnF5alFSrE6MAkjCIkpYQwhkSWMcBllhMsoI6xGxQIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Inspection = _t, Question = _t, Answer = _t]),
#"Pivoted Column" = Table.Pivot(Source, List.Distinct(Source[Question]), "Question", "Answer")
in
#"Pivoted Column"
Regards
Phil
- annag8155 years agoFrequent Visitor
Thank you!