Forum Discussion
Individual Number Formatting
- 7 years ago
Hi Anonymous,
See below an image of how to do the unpivot and pivot on the query editor.
The selection of the columns for the unpivot should compreend all your months.
Regards,
MFelix
Hi Anonymous,
The best way is to unpivot your columns and then Pivot by the Contact Quality.
Check below the M Code for some sample data:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wck7MySlW0lEytDAGk4Yg0tJAKVYnWsmxLLUoMT0VKGKgZ2lhaYjGMDczUYqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Contact quality" = _t, Jan = _t, Feb = _t, Mar = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Contact quality", type text}, {"Jan", type number}, {"Feb", type number}, {"Mar", type number}}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Contact quality"}, "Attribute", "Value"),
#"Pivoted Column" = Table.Pivot(#"Unpivoted Columns", List.Distinct(#"Unpivoted Columns"[Contact quality]), "Contact quality", "Value"),
#"Changed Type1" = Table.TransformColumnTypes(#"Pivoted Column",{{"Average", Percentage.Type}})
in
#"Changed Type1"
Regards,
MFelix
Thank you very much for your replies.
While I'm sure your solutions are helpful, I'm a complete beginner so I don't know how to go about doing the stuff you mentioned.
I would be grateful if you could clarify this. Sorry again!
Kind regards
updog
- MFelix7 years agoSuper User
Hi Anonymous,
See below an image of how to do the unpivot and pivot on the query editor.
The selection of the columns for the unpivot should compreend all your months.
Regards,
MFelix