Forum Discussion
jakoob
3 years agoFrequent Visitor
Pivot in Power Query Help
Hello, I'm currently working with some customer satisfaction data that currently looks similar to the following: Sent Survey ID Survey Question ID Answer Survey ID 1 1 Less than 30 mi...
Ashish_Mathur
3 years agoSuper User
Hi,
This M code works
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
#"Added Prefix" = Table.TransformColumns(Source, {{"Survey Question ID", each "Question " & Text.From(_, "en-IN"), type text}}),
#"Added Suffix" = Table.TransformColumns(#"Added Prefix", {{"Survey Question ID", each _ & " Answer", type text}}),
#"Pivoted Column" = Table.Pivot(#"Added Suffix", List.Distinct(#"Added Suffix"[#"Survey Question ID"]), "Survey Question ID", "Answer")
in
#"Pivoted Column"
Hope this helps.