(question from the web)
Not sure if my Title makes sense, but I'm not sure how else to explain it. I am looking to take the first table (Column A and B) and convert it to return unique values for each unique value in column A. Below is an example and what I am looking the out.
Data I currently have (real data is 50k+ rows)
ABC 123
ABC 123
ABC 456
ABC 789
DEF 123
DEF 123
DEF 789
GHI 1010
GHI 1010
Outcome I am looking to get:
ABC 123 456 789
DEF 123 789
GHI 1010
What is the best approach to do this? I appreciate the help and thank you in advance.
ColA |
ColB |
|
ColA |
ColB |
ABC |
123 |
|
ABC |
123 456 789 |
ABC |
123 |
|
DEF |
123 789 |
ABC |
456 |
|
GHI |
1010 |
ABC |
789 |
|
|
|
DEF |
123 |
|
|
|
DEF |
123 |
|
|
|
DEF |
789 |
|
|
|
GHI |
1010 |
|
|
|
GHI |
1010 |
|
|
|
Code:
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
Group = Table.Group(Source, {"ColA"}, {{"Count", each _, type table}}),
List = Table.AddColumn(Group, "ColB", each List.Distinct([Count][ColB])),
Extract = Table.TransformColumns(List, {"ColB", each Text.Combine(List.Transform(_, Text.From), " "), type text})
in
Extract
Bookmarks