Text.From Function (Power Query M)

Text.From converts a value of almost any scalar type into its text form. Available in Excel (Power Query), Power BI Desktop, and Power BI Service.

If you have a number, date, or true/false value and you need it as text, for example to join it onto another string, this is the function you reach for.

Syntax of Text.From Function

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

where

  • value (required, any). The value to convert to text. It can be a number, date, time, datetime, datetimezone, logical, duration, or binary value.
  • culture (optional, nullable text). The culture used to format the text, for example "en-US". When omitted, Power Query uses the current system culture, so the output format depends on the machine.

Returns: a text value (nullable text) holding the text form of the input. If value is null, it returns null.

In plain terms, you hand it a scalar value and it gives you that value written out as text.

Example 1: Convert a number to text

Turn the number 48230 into a text value.

Text.From(48230)

Result: 48230

The digits are the same, but the result is now a text value rather than a number, so you can join it onto other text.

Example 2: Convert a date to text

Convert a date into text and lock the format by passing a culture.

Text.From(#date(2025,3,9),"en-US")

Result: 3/9/2025

The text form of a date depends on culture, so the output changes from machine to machine when you leave culture out. Passing "en-US" here makes the result a predictable 3/9/2025 everywhere.

Example 3: Convert a logical value to text

Convert a true/false value into text.

Text.From(true)

Result: true

The logical value becomes the lowercase text true. A false value would become false the same way.

Example 4: Build a key from a text and a number column

This is the most common real reason to use Text.From. You cannot join a number directly onto text with the & operator, so you convert it first.

Say you have a Shipments table with a Region (text) and a Year (number) column. You want a BatchKey like WEST-2025.

Here is the starting data:

RegionYear
WEST2025
EAST2024
NORTH2023

Use Table.AddColumn to add a column that joins the region, a dash, and the year converted to text:

let
Source = Excel.CurrentWorkbook(){[Name="Shipments"]}[Content],
AddKey = Table.AddColumn(Source,"BatchKey",each [Region]&"-"&Text.From([Year]),type text)
in
AddKey

Wrapping [Year] in Text.From turns the number into text so the & operator can join it.

The result adds the new key column:

RegionYearBatchKey
WEST2025WEST-2025
EAST2024EAST-2024
NORTH2023NORTH-2023

Without the Text.From wrap, [Region]&"-"&[Year] would throw an error because & cannot join text to a number. For more ways to join columns, see how to concatenate in Power Query.

Example 5: A null value passes through as null

Convert a null value to see what comes back.

Text.From(null)

Result: null

A null input returns null, not the text "null". This means blank source cells stay blank instead of erroring when you run Text.From over a whole column.

Things to keep in mind with Text.From

  • You cannot join a number to text with & directly. [Region]&"-"&[Year] (where Year is a number) throws Expression.Error: We cannot apply operator & to types Text and Number. The & operator only joins text to text, so wrap the numeric side: [Region]&"-"&Text.From([Year]).
  • The text form of a date or number is culture-dependent. With no culture, the output uses the machine’s culture, so the same date can read 3/9/2025 on one machine and 9/3/2025 on another. Pass a culture like "en-US" for a fixed, reproducible string.
  • Structured values are not allowed. Text.From only handles scalar values. A list, record, or table raises an error, so flatten or extract a scalar first.

Common questions about Text.From

How do I fix “We cannot apply operator & to types Text and Number”?

Wrap the number in Text.From before the &. So [Code]&"-"&[Year] becomes [Code]&"-"&Text.From([Year]). The same fix works for joining a date or a logical value into a text expression.

When should I use Number.ToText or Date.ToText instead?

Use Text.From when you just want the default text version of a scalar, which is what you usually need for concatenation and keys. Reach for Number.ToText or Date.ToText when you need a specific pattern, since they take a format string for things like currency, fixed decimals, or an exact date layout.

List of All Power Query Functions

Related Power Query Functions / Articles:

I am a huge fan of Microsoft Excel and love sharing my knowledge through articles and tutorials. I work as a business analyst and use Microsoft Excel extensively in my daily tasks. My aim is to help you unleash the full potential of Excel and become a data-slaying wizard yourself.