Forum Discussion
alameda
6 years agoNew Member
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...
- 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"
artemus
6 years agoMicrosoft Employee
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"- alameda6 years agoNew Member
It works!!! 😊😊😊
Thank you so much.