Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Splitter.SplitTextByDelimiter: Power Query Guide

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Splitter.SplitTextByDelimiter is a Power Query M function that splits a single text value into a list of text fragments, cutting the text wherever a delimiter you choose appears. You use it inside a query step, most often as the second argument of Table.SplitColumn, when you need to break one column apart at the same character or sequence of characters. For example, Splitter.SplitTextByDelimiter(",") turns "Smith, John, 42" into the list {"Smith", " John", " 42"}. Everything else about Power Query (opening the editor, loading or shaping a table) works as usual, so the skill is mostly in getting the arguments right and handling the edge cases around empty values and trailing spaces.

What You'll Need

  • A version of Excel, Power BI Desktop, or another Microsoft product that includes the Power Query Editor, since the M engine ships with all of them.
  • A table already loaded into Power Query (via Data > From Table/Range in Excel, or Get Data in Power BI).
  • A clear idea of what your delimiter actually is: a comma, pipe, semicolon, tab, space, dash, or a multi-character string such as "||".
  • In Excel, the Data tab and the Power Query Editor ribbon visible, so you can reach Home > Transform Data. Menu labels can differ slightly by version and region, so look for the equivalent command if the wording is not identical.

Step-by-Step

  1. Open the Power Query Editor. In Excel, select any cell in your data table and go to Data > From Table/Range. In Power BI Desktop, use Home > Transform data. The editor opens with your table in the middle pane and the Applied Steps list on the right.
  2. Select the column to split. Click the column header of the column you want to break apart. You can split only one column at a time per step, though you can repeat the process for others.
  3. Start the split. On the Home tab, choose Split Column > By Delimiter. A dialog opens with a delimiter dropdown, a split-point selector, and options for advanced settings.
  4. Choose the delimiter or write your own. For common cases the dropdown covers comma, semicolon, colon, tab, space, equals, and similar. If your delimiter is not listed (a pipe, a slash, a double dash), choose Custom and type it into the box. This custom-entry box is exactly what the Splitter.SplitTextByDelimiter function ultimately receives as its first argument.
  5. Pick any unique delimiter handling you need, if the dialog offers it. Real data sometimes contains doubled or string delimiters inside quoted fields. If a delimited-by option such as "Any" or a quote-aware mode is available in your version, use it; otherwise handle those rows by fixing the source first, because the plain function has no awareness of quoting at all.
  6. Set how many columns to create. Choose Split at Each Occurrence of the Delimiter to create one column per piece, or Split at the Left-most/Right-most Delimiter to cut only once. The second option matters when your text contains more commas than you expect, because it protects everything after the first split.
  7. Click OK and inspect the result. Power Query creates new columns named like "Column1.1" and "Column1.2" and adds an Applied Steps entry. Scrolling through the preview is the fastest way to spot rows that did not split as planned.
  8. Rewrite the step as M code if you need control. In the formula bar, the generated step typically reads something like Table.SplitColumn(Source, "Column1", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Column1.1", "Column1.2"}). You can edit the arguments directly. The second argument, QuoteStyle, controls whether quotes are treated specially: QuoteStyle.Csv honours doubled quotes and treats a quoted delimiter as literal text, while QuoteStyle.None splits on every occurrence regardless of quotes. That distinction is the single most useful thing to understand, and it is the reason two seemingly identical files can split differently.
  9. Clean up the output. Splitting preserves leading and trailing spaces, so the second piece in "Smith, John" keeps its leading space. Use Transform > Format > Trim on the new columns, or add Text.Trim inside an M step, and rename the columns to something meaningful before loading.
  10. Check and apply. Click Close & Load (Excel) or Close & Apply (Power BI) to return the shaped table to your workbook or model.

Common Mistakes

The most frequent error is assuming the function trims whitespace. It does not: everything between delimiters is preserved. A second common problem is splitting at every occurrence when only the first split matters, which throws off column alignment on rows with extra delimiters. A third is forgetting that Splitter.SplitTextByDelimiter returns a list; it is not a table function on its own, so calling it in a step by itself produces a list column you then have to expand, rather than separate columns. Finally, people often split text columns whose values can be null, and then wonder why some rows produce an error or an empty list; guard those cases earlier with a replacement step if they matter.

Tips

  • Prefer Table.SplitColumn over manual list handling unless you need unusual logic; it wraps Splitter.SplitTextByDelimiter and handles the column naming for you.
  • Set the data type on the columns before or immediately after splitting. Splitting a timestamp or number that was imported as text also splits it, and splitting an already-typed column can cause errors.
  • Use the formula bar to read what the dialog actually produced. It turns the function into a teaching tool: whatever you click becomes visible M code you can copy, reuse, or tweak.
  • For a delimiter that is a string of characters rather than a single character, type the full string. The function splits on the whole sequence, not on any individual character in it.
  • Keep a copy of the original column (duplicate it before splitting) while you test your setup, so you can compare results or start over without re-importing.

Troubleshooting

If nothing splits, check that the delimiter in your text is the same character you typed. A comma typed on a US keyboard and a full-width comma from another locale look similar but are different characters. Copy the character from the data itself into the custom box. If you get more columns than expected, your source likely contains extra delimiters; switch to splitting at the left-most or right-most occurrence, or clean the source first. If text that contains quoted values splits inside the quotes, your step is using QuoteStyle.None; change it to QuoteStyle.Csv so quoted delimiters are ignored. If a refresh later produces errors, confirm the incoming text has not changed format and that your custom delimiter is still present in the new rows. If the editor refuses the step outright, look at the error detail shown in the step, which names the argument that failed, then correct the function call in the formula bar. When in doubt, delete the split step, reinstate it from the dialog, and compare the generated code with your manual version.

Frequently Asked Questions

Can Splitter.SplitTextByDelimiter split on multiple delimiters at once?

Not in a single argument. It accepts one delimiter string. To split on several characters, replace the alternates with one common character first, or apply two split steps in sequence.

Does it remove empty values?

No. Consecutive delimiters produce empty text entries in the list and empty columns in the table, so filter or clean those afterwards.

What is QuoteStyle.Csv for?

It tells the splitter to respect CSV-style quoting, so a delimiter inside quoted text is not treated as a separator. QuoteStyle.None splits on every occurrence regardless.

Can I use a tab as the delimiter?

Yes. Choose Tab in the dialog, or in M code write the tab character as "#(tab)" inside the string.

Why did my split column disappear after refresh?

Usually a column was renamed or removed upstream. Confirm the earlier steps still produce the same column name and position, and reapply the split step if needed.

Is it available in every Power Query host?

The M engine is shared across Excel, Power BI, and Fabric dataflows, so the function is present wherever the editor is. Exact dialog wording varies by host and version.