Forum Discussion

JustDavid's avatar
JustDavid
Icon for Helper V rankHelper V
2 years ago
Solved

Table.Group Dynamically Columns

Power Query Gurus,   I have a step below where I'm grouping all columns that has 'Column#' where # is a number from 2 onwards.       = Table.Group(Custom1, {"#"Remove Top Rows"}, { {"Column...
  • JustDavid's avatar
    2 years ago

    Per Dino Tao's recommendation so as to mark this thread as solved.

     

    Table.Group(#"PreviousStep", {"Custom"}, 
       List.Transform(
          List.Difference(Table.ColumnNames(#"PreviousStep"), {"Custom"}), 
          (l)=> {l, each List.Sum(Table.Column(_, l)), type number}
       )
    )