Forum Discussion
lf963
3 years agoFrequent Visitor
Line chart with special data
My data is an xlsx file and it looks like the following: Name Day1 Day2 Day3 Day4 Day5 A 5 1 8 6 7 B 1 8 7 2 5 C 4 7 5 2 0 D 8 5 5 6 2 The ...
- 3 years ago
Unpivot your data.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTIFYkMgtgBiMyA2V4rViVZyQhI1B2IjsEqQjDOQZQIVNYXKGIBlXKDqTaHYDCwbGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Name " = _t, #" Day1 " = _t, #" Day2 " = _t, #" Day3 " = _t, #" Day4 " = _t, #" Day5 " = _t]), #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Name "}, "Day", "Value"), #"Changed Type" = Table.TransformColumnTypes(#"Unpivoted Other Columns",{{"Value", type number}}) in #"Changed Type"Then everything else works automatically.
lbendlin
3 years agoSuper User
Unpivot your data.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTIFYkMgtgBiMyA2V4rViVZyQhI1B2IjsEqQjDOQZQIVNYXKGIBlXKDqTaHYDCwbGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Name " = _t, #" Day1 " = _t, #" Day2 " = _t, #" Day3 " = _t, #" Day4 " = _t, #" Day5 " = _t]),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Name "}, "Day", "Value"),
#"Changed Type" = Table.TransformColumnTypes(#"Unpivoted Other Columns",{{"Value", type number}})
in
#"Changed Type"
Then everything else works automatically.