Forum Discussion
ErinKlomp
2 years agoNew Member
Pivot some columns
Hi all, another question from a first time user. I finally have all my data, but now as a final step, I want to pivot some of my colums. I have 4 colums, where I want to pivot two of the colums (and...
- 2 years ago
Hi ErinKlomp, if you want Power Query solution:
Result
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrU0NDFU0lFydAQSIEZRanFBvGG8Y066oVKsDpoCYxQFRpgKjKAKwPLGcHmQsJMTkDDBYQNcgREOG+AKDNBsiAUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [evaluatieperiodeid = _t, specialisme = _t, gegevenantwoordwaarde = _t, vraagcode = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"gegevenantwoordwaarde", Int64.Type}}), #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[vraagcode]), "vraagcode", "gegevenantwoordwaarde") in #"Pivoted Column"
dufoq3
2 years agoCommunity Champion
Hi ErinKlomp, if you want Power Query solution:
Result
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrU0NDFU0lFydAQSIEZRanFBvGG8Y066oVKsDpoCYxQFRpgKjKAKwPLGcHmQsJMTkDDBYQNcgREOG+AKDNBsiAUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [evaluatieperiodeid = _t, specialisme = _t, gegevenantwoordwaarde = _t, vraagcode = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"gegevenantwoordwaarde", Int64.Type}}),
#"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[vraagcode]), "vraagcode", "gegevenantwoordwaarde")
in
#"Pivoted Column"