Date.ToText

Date

Converts a date value to a text string.

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

Syntax

Date.ToText(date as nullable date, optional options as any) as nullable text

Parameters

NameTypeRequiredDescription
datedateYesThe date value to convert to text.
optionsanyNoA record or culture text string. Supported record fields: Format (custom format string, e.g., "dd/MM/yyyy") and Culture (e.g., "en-US").

Return Value

textA text representation of the date, or null if the input is null.

Remarks

Date.ToText formats a date value as a text string. Without options, it produces an ISO 8601-style string (e.g., "2024-03-15"). Use the Format field in the options record to apply custom patterns such as "dd/MM/yyyy" or "MMMM d, yyyy". The Culture field controls locale-specific formatting (e.g., month names and day-of-week names). Format strings follow .NET custom date format conventions.

Always specify Culture when using locale-sensitive format specifiers like MMMM (full month name) or dddd (full day name) to ensure consistent output across environments. Without an explicit Culture, the result depends on the host machine's locale.

If the input is null, the function returns null. For formatting datetime values, use DateTime.ToText instead, which handles both date and time components.

Examples

Example 1: Format order dates as long-form text

Table.AddColumn(
    Table.SelectColumns(
        Table.FirstN(Sales, 4),
        {"OrderID", "OrderDate"}
    ),
    "OrderDateText",
    each Date.ToText([OrderDate], [Format="MMMM d, yyyy", Culture="en-US"]),
    type text
)
Result
OrderID
OrderDate
OrderDateText
111/15/2024January 15, 2024
221/18/2024January 18, 2024
332/1/2024February 1, 2024
442/10/2024February 10, 2024

Example 2: Format a date in UK style

#table(
    type table [Date = date, Formatted = text],
    {{#date(2024, 3, 15), Date.ToText(#date(2024, 3, 15), [Format="dd/MM/yyyy", Culture="en-GB"])}}
)
Result
Date
Formatted
13/15/202415/03/2024

Example 3: Format as abbreviated month and year

Table.AddColumn(
    Table.SelectColumns(Table.FirstN(Sales, 5), {"OrderID", "OrderDate"}),
    "PeriodLabel",
    each Date.ToText([OrderDate], [Format="MMM yyyy", Culture="en-US"]),
    type text
)
Result
OrderID
OrderDate
PeriodLabel
111/15/2024Jan 2024
221/18/2024Jan 2024
332/1/2024Feb 2024
442/10/2024Feb 2024
553/5/2024Mar 2024

Compatibility

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