Forum Discussion
How to pivot and display multiple values
- 4 years ago
Hi Anonymous ,
I am always up for improved solutions, but in this case I'm wondering why.
My pivot solution isn't only faster to implement but will also run faster when executed. Or am I missing something here?:
Hi joxe ,
pivoting is still the way to go, but you have to adjust the aggregation function for the values:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8s3PS0msVNJRMrC0MjAA0r6JRZVKsTpYZLzyM/LAMiGlqcUQKUMDiJRjHlAmFgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Day = _t, Hour = _t, Name = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Day", type text}, {"Hour", type time}, {"Name", type text}}),
#"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Day]), "Day", "Name", each Text.Combine(_, "#(lf)"))
in
#"Pivoted Column"