I have Excel data which looks something like this:
Sources Targets Routes
Lemons Chair A,D
Lemons Chair D,F
Oranges Chair B,F,G
Oranges Chair B,C
Oranges Door A,G
Oranges Door B,C
I am trying to use Power Query to condense it to this:
Sources Targets Routes
Lemons Chair A,D,F
Oranges Chair B,C,F,G
Oranges Door A,B,C,G
That is, for each Source/Target pair, I need to
- Split apart the comma-delimited Routes,
- Eliminate the duplicate routes
- Combine the routes back into a comma-delimited list
- Display it in a single record for the Source/Target pair.
There is a max of 3 routes in Routes source data. I'm pretty sure I need to split the Routes column into 3 columns, then use Group. But there I get stuck.
Suggestions?