Forum Discussion
pect
8 years agoHelper I
Table transformation
Hello, I am trying to transform a table which is: Client Estat Any Import EU Línea base 2017 10000 EU Adjudicat 2017 3000 EU En contractació 2017 2000 EU En contracta...
- 8 years ago
The suggested (un)pivot solution could look like this:
let Source = Table1, #"Pivoted Column" = Table.Pivot(Source, List.Distinct(Source[Estat]), "Estat", "Import"), #"Added Custom" = Table.AddColumn(#"Pivoted Column", "Pendent", each [Línea base] - [Adjudicat] - [En contractació], Int64.Type), #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Línea base"}), #"Reordered Columns" = Table.ReorderColumns(#"Removed Columns",{"Client", "Any", "Pendent", "Adjudicat", "En contractació"}), #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Reordered Columns", {"Client", "Any"}, "Attribute", "Value") in #"Unpivoted Columns"
v-jiascu-msft
8 years agoMicrosoft Employee
Hi pect,
Could you please mark the proper answer as solution? That will be a big help to the others.
Best Regards!
Dale