Forum Discussion
Cramos
9 years agoFrequent Visitor
Agroup and concatenate column with a common value
Hi! Sorry, this has probably been asked before but I have not been able to find it. I have to columns, column 1 have repeated values and column 2 unique values. I would like to agrupate the r...
- 9 years ago
In the Query Editor, you can use the Group By option.
First choose some aggregation for column 2 to create base code, e.g. Sum:
(ignore any errors) and adjust the generated code to:
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}}), #"Grouped Rows" = Table.Group(#"Changed Type", {"Column1"}, {{"Column2 Values", each Text.Combine([Column2],","), type text}}) in #"Grouped Rows"Notice that Column2 is typed as text.
ChemEnger
4 years agoAdvocate V
I know this is an old thread but it helped me out no end, thanks! For others that stumble across this reply, there is an Idea but with hardly any votes: Microsoft Idea ยท Incorporate the Concatenate operator to the Group By function (powerbi.com)