DAX Date & Time - DATEVALUE function



Description

Converts a date in the form of text to a date in datetime format.

Syntax

DATEVALUE (<date_text>) 

Parameters

Sr.No. Parameter & Description
1

date_text

Text that represents a date.

Return Value

A date in datetime format.

Remarks

The DATEVALUE function uses the locale and date/time settings of the client computer to understand the text value when performing the conversion.

  • If the current date/time settings represent dates in the format of Month/Day/Year, then the string, "1/8/2015", would be converted to a datetime value equivalent to January 8th of 2015.

  • If the current date and time settings represent dates in the format of Day/Month/Year, the same string would be converted as a datetime value equivalent to August 1st of 2015.

  • 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.

Example

= DATEVALUE ("1/8/2016") returns 1/8/2016 12:00:00 AM. 
= DATEVALUE("8-Jan-2016") returns 1/8/2016 12:00:00 AM. 
= DATEVALUE("8-Jan") returns 1/8/2016 12:00:00 AM.
dax_functions_date_time.htm
Advertisements