Forum Discussion

alameda's avatar
alameda
New Member
6 years ago
Solved

Conditional column which merges all coincident values

Hi: I'm trying to get a conditional column which merges all the values from the column B which value in the column A is the same. For example, mi desiredColumn would be something like this: col...
  • artemus's avatar
    6 years ago

    You can do it more simply like:

    let
        Source = #table(type table [columnA=Int32.Type, columnB=text], {{1, "A"}, {2, "B"}, {2, "C"}, {3, "D"}, {3, "E"}, {3, "F"}, {4, "G"}}),
        #"Added Custom" = Table.AddColumn(Source, "desiredColumn", each Text.Combine(Table.SelectRows(Source, (x) => [columnA] = x[columnA])[columnB], "|"))
    in
        #"Added Custom"