Combiner.CombineTextByEachDelimiter
CombinerReturns a function that combines a list of text values using a sequence of delimiters, one per position.
Syntax
Combiner.CombineTextByEachDelimiter(delimiters as list, optional quoteStyle as nullable number) as functionParameters
| Name | Type | Required | Description |
|---|---|---|---|
delimiters | list | Yes | A list of text delimiters. The first delimiter is used between the first and second values, the second delimiter between the second and third, and so on. |
quoteStyle | number | No | A QuoteStyle value specifying how to handle quoting. Defaults to QuoteStyle.None. |
Return Value
function — A function that takes a list of text values and combines them using a different delimiter between each consecutive pair.
Remarks
Combiner.CombineTextByEachDelimiter returns a function that uses a different delimiter at each join position. For example, given delimiters {" - ", ": "}, the first and second values are joined with " - " and the second and third with ": ". This is useful when building structured strings where different separators are needed between fields.
Examples
Example 1: Combine with positional delimiters
let
Subset = Table.SelectColumns(Table.FirstN(Sales, 3), {"Product", "Category", "Region"}),
CombinerFn = Combiner.CombineTextByEachDelimiter({" | ", " -> "}),
Combined = Table.ToList(Subset, CombinerFn)
in
#table({"Formatted"}, List.Transform(Combined, each {_}))Result
Formatted | |
|---|---|
| 1 | Widget A | Widgets -> East |
| 2 | Gadget B | Gadgets -> West |
| 3 | Widget C | Widgets -> East |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks