Forum Discussion
AnonymeC
3 years agoRegular Visitor
Equivalent to "Group By" function on multiple columns?
Hello, I have a huge database that basically looks like: Code Market Factory Jul 21 Aug 21 Sep 21 .... Apr 23 May 23 Jun 23 3424555332 DACH XXX 0 34 24 ... 22 50 12 ...
- 3 years ago
Hi
UnPivot then pivot
let
Source = YourSource,
UnPivot = Table.UnpivotOtherColumns(Source, {"Code", "Market", "Factory"}, "Attribute", "Value"),
Pivot = Table.Pivot(UnPivot, List.Distinct(UnPivot[Attribute]), "Attribute", "Value", List.Sum)
in
PivotStéphane
AlienSx
Super User
3 years agoHello, AnonymeC how would you like to summarize other columns? In general, one need to group by first 3 columns and select "All rows" as "operation". This gives you the whole table. One may apply a custom (user defined) function then to modify that table to get what you want. Just let us know what would you like to do to other columns - simple sum operation?