Downloads
Power Query MDateIntermediate

Date.FromText

Reads a date from text, using a format and culture you specify.

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

Returns: The date, or null when the input is null. An error when the text does not match the format.

What it does

Date.FromText reads a date typed as text. The text "03/04/2026" is March 4 in the US and April 3 in the UK. A bank export read with the wrong order will not fail. It will quietly produce the wrong dates for any day that is 12 or less. Naming the format and the culture removes that doubt, and it is the reason to use this function instead of Date.From for outside data.

Syntax and arguments

Example

A US bank sends dates as month, day and year. A UK bank sends dates as day, month and year. The team reads each feed with its own format, so both give the same kind of date.

let
    UsDate = Date.FromText("10/29/2026", [Format = "MM/dd/yyyy", Culture = "en-US"]),
    UkDate = Date.FromText("29/10/2026", [Format = "dd/MM/yyyy", Culture = "en-GB"]),
    IsoDate = Date.FromText("2026-10-29")
in
    {UsDate, UkDate, IsoDate}

All three values are October 29, 2026. Each feed is read with the order its bank uses, so the dates agree.

Example: a second, different use

Read a value date from a payment file that uses day, month and year with a dot separator, such as "29.10.2026", with the format "dd.MM.yyyy" and culture "de-DE".

Things to watch

In business terms

Bank, payroll and customs files arrive with dates in local formats. Reading the date with its stated format is how a team avoids a month-end where invoices appear to be posted to the wrong month.

Related functions

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