Splitter.SplitTextByEachDelimiter
SplitterReturns a function that splits text using a different delimiter at each split position.
Syntax
Splitter.SplitTextByEachDelimiter(delimiters as list, optional quoteStyle as nullable number, optional startAtEnd as nullable logical) as functionParameters
| Name | Type | Required | Description |
|---|---|---|---|
delimiters | list | Yes | A list of text delimiters. The first delimiter is used for the first split, the second for the next split, and so on. |
quoteStyle | number | No | A QuoteStyle value specifying how to handle quoted sections. Defaults to QuoteStyle.None. |
startAtEnd | logical | No | If true, splits are applied starting from the end of the text. Defaults to false. |
Return Value
function — A function that takes a text value and returns a list of text parts, using a different delimiter for each successive split.
Remarks
Splitter.SplitTextByEachDelimiter returns a function that applies a sequence of delimiters in order. The first delimiter splits the text into two parts, the second delimiter splits the remainder, and so on. The number of resulting parts is always one more than the number of delimiters.
Set startAtEnd to true to apply delimiters from right to left, which is useful for splitting text where the last portions have a known structure but earlier parts may contain the delimiter.
Examples
Example 1: Split formatted text with positional delimiters
let
Source = Table.AddColumn(
Table.FirstN(Sales, 3),
"Combo", each [CustomerName] & " - " & [Product] & " / " & [Region], type text
),
SplitFn = Splitter.SplitTextByEachDelimiter({" - ", " / "})
in
Table.SelectColumns(
Table.SplitColumn(
Table.SelectColumns(Source, {"Combo"}),
"Combo", SplitFn, {"Name", "Product", "Region"}
),
{"Name", "Product", "Region"}
)Result
Name | Product | Region | |
|---|---|---|---|
| 1 | Alice | Widget A | East |
| 2 | Bob | Gadget B | West |
| 3 | Charlie | Widget C | East |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks