Date.From
DateConverts a value to a date.
Syntax
Date.From(value as any, optional culture as nullable text) as nullable dateParameters
| Name | Type | Required | Description |
|---|---|---|---|
value | any | Yes | The value to convert to a date. Accepts text, datetime, datetimezone, and number values. |
culture | text | No | Optional culture code for locale-aware text parsing (e.g., "en-US"). |
Return Value
date — The date converted from the given value.
Remarks
Date.From converts text, datetime, datetimezone, or number values into a date. Text values are parsed according to standard date formats or the specified culture. Number values are interpreted as OLE Automation dates (days since December 30, 1899). If the input is null, the function returns null.
Examples
Example 1: Convert text dates to date values
Table.TransformColumns(
Table.SelectColumns(
Table.FirstN(Employees, 3),
{"FullName", "HireDate"}
),
{{"HireDate", each Date.From(_), type date}}
)Result
FullName | HireDate | |
|---|---|---|
| 1 | John Smith | 3/15/2021 |
| 2 | Sara Johnson | 7/1/2019 |
| 3 | Mike Davis | 1/10/2022 |
Example 2: Convert a text string to a date
#table(
type table [Result = date],
{{Date.From("2024-06-15")}}
)Result
Result | |
|---|---|
| 1 | 6/15/2024 |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks