let
Source = #table({"Column1", "Column2", "Column3"}, {{"Fruit","Apple","Market"},{"Fruit","Orange","Store"},{"Fruit","Orange",null},{"Fruit","Banana",null},{"Fruit","Orange",null},{"Fruit","Berries",null}}),
#"Grouped Rows" = Table.Group(Source, {"Column1"}, {{"Count", each _, type table}}),
#"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Text.Combine([Count][Column2],"#(lf)")),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each Text.Combine([Count][Column3],"#(lf)")),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom1",{"Count"})
in
#"Removed Columns"
Book1 | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | Column1 | Custom | Custom.1 | ||
2 | Fruit | Apple Orange Orange Banana Orange Berries | Market Store | ||
Sheet2 |
Book1 | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | Column1 | Custom | Custom.1 | ||
2 | Fruit | Apple Orange Banana Berries | Market Store | ||
Sheet2 |
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
tbl = Table.TransformColumns(Source, {"Custom", each Text.Combine(List.Distinct(Text.Split(_, "#(lf)")), "#(lf)")})
in
tbl