Forum Discussion

jct999's avatar
jct999
Advocate II
2 years ago
Solved

Dynamic grouping with M (PQ)

Hello, I have a table myTable with 21 columns : The first one is the column "key" The others are named "value_1", "value_2" .... "value_20" I have a list that contains a subset of the colum...
  • slorin's avatar
    2 years ago

    Or with Table.Group

    = Table.Group(
    myTable,
    {"key"},
    List.Transform(
    myList,
    each {
    "Sum_"& _,
    Expression.Evaluate("each List.Sum(["& _ &"])", #shared),
    type number
    }
    )
    )

    Stéphane