Forum Discussion

SebSchoon1's avatar
SebSchoon1
Icon for Post Patron rankPost Patron
4 years ago
Solved

Dynamic Table.GROUP with Dynamic List.Sum

Hello Guys,   New Challenge today   Table.Group(#"My Whole Table",#"List of columns not to aggregate",List.Sum(#"List of columns i want to aggregate") As Whole Number) Is there a way to do this?...
  • SebSchoon1's avatar
    4 years ago

    Hey Guys,

     

    Here the answer !

     

    I have found this on the internet and adapted to my Case

    https://stackoverflow.com/questions/65342143/power-query-table-group-with-a-dynamic-list-of-aggregated-columns

     

    This adapted to my situation is 

     

    = Table.Group(#"Lignes triées", #"Lignes filtrées1", List.Transform(#"Detection des Tailles 11 On garde une liste", (C)=> {C, each List.Sum(Table.Column(_,C)), Int64.Type}))

    in simple words

    = Table.Buffer(Table.Group(#"Step in which i need this", #"List of columns i want to keep", List.Transform(#"List of columns i want to aggregate", (C)=> {C, each List.Sum(Table.Column(_,C)), Int64.Type})))

     

     

    You're the gods guys!