Forum Discussion
Adam01
4 years agoAdvocate I
Combining Rows based on the ID of that table
Hello! I am wanting to combine values based on the unique ID of that table, so for any values that have the same ID I want them to be pushed into the same cell. To explain this better I've includ...
- 4 years ago
You can do this with a small tweak to Group By.
Click Group By under the Home tab and group by ID taking the max over Value.
This generates code that looks like this:
= Table.Group(#"Changed Type", {"ID"}, {{"Value", each List.Max([Value]), type nullable text}})We don't actually want List.Max though. Replace that with Text.Combine like this:
= Table.Group(#"Changed Type", {"ID"}, {{"Value", each Text.Combine([Value], ", "), type text}})
AlexisOlson
4 years agoSuper User
You can do this with a small tweak to Group By.
Click Group By under the Home tab and group by ID taking the max over Value.
This generates code that looks like this:
= Table.Group(#"Changed Type", {"ID"}, {{"Value", each List.Max([Value]), type nullable text}})
We don't actually want List.Max though. Replace that with Text.Combine like this:
= Table.Group(#"Changed Type", {"ID"}, {{"Value", each Text.Combine([Value], ", "), type text}})
Anonymous
3 years agoNot applicable
Perfect! Thank you!