r/ExcelPowerQuery • u/MutedZombie1545 • Apr 29 '24
Power Query - Split 2 columns both with a delimiter
I need two split two columns both with a semicolon delimiter in Power Query (or if there's a better tool, lmk!). The first column will have each of the data from column B, see below:
Raw data:
| Column A | Column B |
|---|---|
| red;yellow | apple;mango |
Intended Result:
| Column A | Column B |
|---|---|
| red | apple |
| red | mango |
| yellow | apple |
| yellow | mango |
1
Upvotes
3
u/[deleted] May 04 '24
You can also try this.
1
u/ThunderJenkins May 01 '24
Try this:
1
u/Dwa_Niedzwiedzie May 26 '24
letSource = Table.FromColumns({{"red;yellow"}, {"apple;mango"}}, {"Column A", "Column B"}),#"Split Columns by Delimiter" = Table.TransformColumns(Source,{},Splitter.SplitTextByDelimiter(";")),#"Expanded Column A" = Table.ExpandListColumn(#"Split Columns by Delimiter", "Column A"),#"Expanded Column B" = Table.ExpandListColumn(#"Expanded Column A", "Column B")in#"Expanded Column B"