Text.Format
A text with placeholders filled in from a list or a record: #{0} takes the first item, #[Name] a field.
Group: Text and characters. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Text.Format(formatString as text, arguments as any, optional culture as nullable text) as text
| Parameter | Type | Description |
|---|---|---|
formatString | text | The text with placeholders: #{0}, #{1} ... for a list, #[field] for a record. |
arguments | any | A list (placeholders by position from 0) or a record (by field name). |
culture | nullable text optional | A culture's name for how numbers and dates are written. Left out, the culture of the query. |
Returns
text. The text with each placeholder replaced by its value written as text.
Remarks
- Values are written as
Text.Fromwrites them, in the culture given. Left out, the culture is the query's (Culture.Current): the model's Locale for import, else the model's own culture, else en-US. The examples here run in en-US. - A placeholder with no value to fill it, such as #{2} with a list of two, is an error.
Examples
From a list
Text.Format("Order #{0} ships to #{1}", {1001, "Oslo"})
"Order 1001 ships to Oslo"
From a record
Text.Format("#[Product] costs #[Price]", [Product = "Chair", Price = 49.5])
"Chair costs 49.5"
A date in Norwegian
Text.Format("Order #{0} on #{1}", {1001, #date(2026, 3, 1)}, "nb-NO")
"Order 1001 on 01.03.2026"