Date.From

The function returns a date value based on the input provided. You can also specify an optional culture (for example, "en-US"). If the input value is null, the function returns null. If the input valu...

Syntax

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

About

The function returns a date value based on the input provided. You can also specify an optional culture (for example, "en-US"). If the input value is null, the function returns null. If the input value is already a date, it will be returned as is. Different types of input values can be converted to a date: - `text`: Converts a textual representation of a date to a date value. For more information, refer to the Date.FromText function. - `datetime`: Uses the date component of the input value. - `datetimezone`: Uses the date component of the local datetime equivalent of the input value. - `number`: Uses the date component of the datetime equivalent of the OLE Automation Date that is represented by the input value. If the input value is of any other type, an error will be returned.

Explanation

Example 1: Transform the numeric value 43910 into a date format using Power Query. The result will be March 20, 2020. Example 2: Transform the date and time value #datetime(1899, 12, 30, 06, 45, 12) into a date format using Power Query. The output will be December 30, 1899.