A column holding two facts, such as West-042, cannot be grouped by region or looked up by code until it is split. Power Query Split Column by Delimiter does it as a recorded step, so next month file splits the same way on refresh.
What you need
- Excel with the data loaded in the Power Query Editor
- A note of the delimiter used in the combined column
- A copy of the source file
Step 1: Select the column and choose Split by Delimiter
Select the combined column, then choose Transform, Split Column, By Delimiter. Pick the delimiter the data uses, such as a hyphen, comma or space.
Step 2: Choose where to split
Choose At the left-most delimiter, Each occurrence, or At the right-most delimiter, depending on how many parts the value holds. For a two-part code, the left-most delimiter is usually right.
Step 3: Rename the new columns and check the rows
Rename the split columns to meaningful names, such as Region and Code. Confirm the row count is unchanged and read a few split rows against the original values.
Worked example: synthetic 30-row region code column
The table below is a synthetic example. It shows the expected result of splitting a column in Power Query; no file was imported.
| Check | Count | Result |
|---|---|---|
| Rows before splitting | 30 | Source |
| Rows after splitting | 30 | No rows added or lost |
| Rows split into two parts | 30 | Pass |
| Rows with a missing delimiter | 0 | None |
Expected result (UNTESTED). all 30 rows split into Region and Code, with the row count unchanged and no row missing its delimiter. This check was not run live; the table shows the expected result for the synthetic example.
Limits
- Split By Number of Characters is the option for fixed-width feeds with no delimiter.
- A delimiter that appears inside a value will split that value further; check the results.
- Rename the split columns at once, or later steps will refer to confusing default names.
