Combiner.CombineTextByEachDelimiter

Combiner

Returns a function that combines a list of text values using a sequence of delimiters, one per position.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Combiner.CombineTextByEachDelimiter(delimiters as list, optional quoteStyle as nullable number) as function

Parameters

NameTypeRequiredDescription
delimiterslistYesA 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.
quoteStylenumberNoA QuoteStyle value specifying how to handle quoting. Defaults to QuoteStyle.None.

Return Value

functionA 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
1Widget A | Widgets -> East
2Gadget B | Gadgets -> West
3Widget C | Widgets -> East

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks