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: Nov 14, 2024   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo

2018-2024 © SQLBI. All rights are reserved. Information coming from Microsoft documentation is property of Microsoft Corp. » Contact us   » Privacy Policy & Cookies

Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.

Iterator

Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.

Deprecated

This function is deprecated. Jump to the Alternatives section to see the function to use.

Volatile

A volatile function may return a different result every time you call it, even if you provide the same arguments. Click to read more.

Deprecated

This parameter is deprecated and its use is not recommended.

DirectQuery compatibility

Limitations are placed on DAX expressions allowed in measures and calculated columns.
The state below shows the DirectQuery compatibility of the DAX function.

Contribute

Want to improve the content of NETWORKDAYS? Did you find any issue?
Please, report it us! All submissions will be evaluated for possible updates of the content.


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.