Search code examples
powerbipowerbi-desktop

Combine like values from rows and concatenate subsequent columns


I have a problem that I am sure is probably pretty basic, but my brain has quit functioning, and I can't get past this.  I have a table with two columns.  An ID column and a Service column.  Shown below:

enter image description here

As you can see, the ID column has duplicate values, I would like to combine the duplicates in the ID column and then concatenate the Service column for each row as shown below:

enter image description here

ANy help would be GREATLY appreciated!!!


Solution

  • enter image description here

    In the query editor go to Group by

    enter image description here

    This throws an error. Now edit the code line above from

    = Table.Group(#"Changed Type", {"Column1"}, {{"Column3", each List.Sum([Column2]), type nullable text}})

    to

    = Table.Group(#"Changed Type", {"Column1"}, {{"Column3", each Text.Combine([Column2], ", "), type nullable text}})

    and you will get:

    enter image description here