Events
Sep 15, 6 AM - Sep 17, 3 PM
The best Power BI community-led event. Sept 2025. Use code FABLEARN to save €200.
Get registeredThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
Calculated column
Calculated table
Measure
Visual calculation
Converts a date in text format to a date in datetime format.
DATEVALUE(date_text)
Term | Definition |
---|---|
date_text |
Text that represents a date. |
A date in datetime
format.
When converting, DATEVALUE uses the locale and date/time settings of the model to determine a date value. If the model date/time settings represent dates in the format of Month/Day/Year, then the string, "1/8/2009", is converted to a datetime
value equivalent to January 8th of 2009. However, if the model date/time settings represent dates in the format of Day/Month/Year, the same string is converted as a datetime
value equivalent to August 1st of 2009.
If conversion using the locale and date/time settings of the model fails, DATEVALUE will attempt to use other date formats. In this case, some rows may be converted using one format and other rows are converted using a different format. For example, "5/4/2018" may convert to May 4th of 2018, and "20/4/2018" may convert to April 20th.
If the year portion of the date_text
argument is omitted, the DATEVALUE function uses the current year from your computer's built-in clock. Time information in the date_text
argument is ignored.
Model locale and data/time settings are initially determined by the application and computer when the model is created.
Date and datetime can also be specified as a literal in the format dt"YYYY-MM-DD"
, dt"YYYY-MM-DDThh:mm:ss"
, or dt"YYYY-MM-DD hh:mm:ss"
. When specified as a literal, using the DATEVALUE function in the expression is not necessary. To learn more, see DAX Syntax | Date and time.
The following example returns a different datetime
value depending on the model locale and settings for how dates and times are presented.
In date/time settings where the day precedes the month, the example returns a datetime
value corresponding to January 8th of 2009.
In date/time settings where the month precedes the day, the example returns a datetime
value corresponding to August 1st of 2009.
= DATEVALUE("8/1/2009")
Events
Sep 15, 6 AM - Sep 17, 3 PM
The best Power BI community-led event. Sept 2025. Use code FABLEARN to save €200.
Get registeredAsk Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in