Forum Discussion

zraptor's avatar
zraptor
Frequent Visitor
3 years ago
Solved

Grouping rows by like values and combining subsequent columns

Hello!  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.  Sh...
  • Ashish_Mathur's avatar
    3 years ago

    Hi,

    This M code works

    let
        Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Service", type text}}),
        #"Grouped Rows" = Table.Group(#"Changed Type", {"ID"}, {{"All services", each Text.Combine([Service], ", ")}})
    in
        #"Grouped Rows"

    Hope this helps.