Text.Combine
Texts from a list joined into one, with a separator between them if you give one.
Group: Text and characters. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Text.Combine(texts as list, optional separator as nullable text) as text
| Parameter | Type | Description |
|---|---|---|
texts | list | The texts to join, in order. |
separator | nullable text optional | What goes between two texts. Left out, nothing. |
Returns
text. One text; an empty text for an empty list.
Remarks
- Nulls in the list are skipped, separator and all.
- Every item must be a text or null: turn numbers and dates into text first with
Text.From.
Examples
A list of cities
Text.Combine({"Oslo", "Bergen", "Trondheim"}, ", ")
"Oslo, Bergen, Trondheim"
A missing part
Text.Combine({"NO", null, "0150"}, "-")
"NO-0150"
The null leaves no empty slot between two dashes.
A code from a number
Text.Combine({"SKU", Text.From(123)}, "-")
"SKU-123"
Related functions
Text.Split, Combiner.CombineTextByDelimiter, Text.From, Text.Format.