Date and Time Functions
Date and time functions help creating calculations based on dates and time. Many of the functions in DAX are similar to the Excel date and time functions.
Function | Description |
---|---|
CALENDAR | Returns a table with one column of all dates between StartDate and EndDate. |
CALENDARAUTO | Returns a table with one column of dates calculated from the model automatically. |
DATE | Returns the specified date in datetime format. |
DATEDIFF | Returns the number of units (unit specified in Interval) between the input two dates. |
DATEVALUE | Converts a date in the form of text to a date in datetime format. |
DAY | Returns a number from 1 to 31 representing the day of the month. |
EDATE | Returns the date that is the indicated number of months before or after the start date. |
EOMONTH | Returns the date in datetime format of the last day of the month before or after a specified number of months. |
HOUR | Returns the hour as a number from 0 (12:00 A.M.) to 23 (11:00 P.M.). |
MINUTE | Returns a number from 0 to 59 representing the minute. |
MONTH | Returns a number from 1 (January) to 12 (December) representing the month. |
NETWORKDAYS | Returns the number of whole workdays between two dates (inclusive) using parameters to indicate which and how many days are weekend days. Weekend days and any days that are specified as holidays are not considered as workdays. |
NOW | Returns the current date and time in datetime format. |
QUARTER | Returns a number from 1 (January-March) to 4 (October-December) representing the quarter. |
SECOND | Returns a number from 0 to 59 representing the second. |
TIME | Converts hours, minutes, and seconds given as numbers to a time in datetime format. |
TIMEVALUE | Converts a time in text format to a time in datetime format. |
TODAY | Returns the current date in datetime format. |
UTCNOW | Returns the current date and time in datetime format expressed in Coordinated Universal Time (UTC). |
UTCTODAY | Returns the current date in datetime format expressed in Coordinated Universal Time (UTC). |
WEEKDAY | Returns a number identifying the day of the week of a date. The number is in a range 1-7 or 0-6 according to the choice of the ReturnType parameter. |
WEEKNUM | Returns the week number in the year. |
YEAR | Returns the year of a date as a four digit integer. |
YEARFRAC | Returns the year fraction representing the number of whole days between start_date and end_date. |
Last update: Dec 4, 2024 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo