Downloads
Power Query MTextBeginner

Text.From

Converts a number, date, time or logical value to text.

Syntax
Text.From(value as any, optional culture as nullable text) as nullable text

Returns: The value as text, or null when the input is null.

What it does

Text.From turns a value into text. Finance teams use it to join a number to a text column, to pad an account number with zeros, or to build a label. It follows the culture of the machine unless you say otherwise, and that is the trap. A value written with a decimal point on one computer can come out with a decimal comma on another.

Syntax and arguments

Example

A monthly close file builds a key from a period number and an account number. The period is a number, so Text.From makes it text before the key is joined.

let
    Period = 9,
    Account = 4010,
    Key = Text.From(Period) & "-" & Text.From(Account),
    Decimal = Text.From(1234.5, "en-US"),
    German = Text.From(1234.5, "de-DE")
in
    {Key, Decimal, German}

Key is "9-4010". With "en-US" the decimal is "1234.5", and with "de-DE" the same number is "1234,5". The two text values are not the same, which is why the culture should be stated.

Example: a second, different use

Convert a date to text with Date.ToText and an explicit format, instead of relying on Text.From, so the output looks the same every time.

Things to watch

In business terms

Keys, labels and export files need text in a fixed form. Converting with a stated culture keeps a monthly key the same on the analyst's laptop and on the server that refreshes the report.

Related functions

All Power Query M functions · View as Markdown · M basics