DAX date and time functions: every one with an example

A reference of all DAX date and time functions, building dates (DATE, TIME, DATEVALUE, CALENDAR, CALENDARAUTO), splitting them (YEAR, MONTH, DAY, WEEKDAY, WEEKNUM, QUARTER), moving them (EDATE, EOMONTH), differences (DATEDIFF, YEARFRAC, NETWORKDAYS) and now (TODAY, NOW, UTCNOW), with examples.

Short answer: DAX date and time functions work on single values, like Excel's: build a date (DATE ( 2026, 10, 29 )), take it apart (YEAR, MONTH, WEEKNUM), move it (EDATE, EOMONTH), measure between two dates (DATEDIFF, NETWORKDAYS, YEARFRAC), or get the current time (TODAY, NOW). CALENDAR and CALENDARAUTO build whole date tables. For periods and comparisons, use the time intelligence functions.

These are the functions of date table columns, ages, durations, due dates and "days since last order".

Which functions build dates and tables?

FunctionReturnsExample
DATEa date from year, month, dayDATE ( 2026, 10, 29 )
TIMEa time from hour, minute, secondTIME ( 14, 30, 0 )
DATEVALUEa date from textDATEVALUE ( "2026-10-29" )
TIMEVALUEa time from textTIMEVALUE ( "14:30" )
CALENDARa table of dates from start to endCALENDAR ( DATE ( 2022, 1, 1 ), DATE ( 2026, 12, 31 ) )
CALENDARAUTOa table of whole years covering the model's datesCALENDARAUTO ( 6 )
Building

CALENDARAUTO ( 6 ) builds fiscal years ending in June. See the date table post.

Which functions take dates apart?

FunctionReturnsExample
YEARthe yearYEAR ( 'Date'[Date] )
QUARTER1 to 4QUARTER ( 'Date'[Date] )
MONTH1 to 12MONTH ( 'Date'[Date] )
DAY1 to 31DAY ( 'Date'[Date] )
WEEKDAY1 to 7; return type 2 makes Monday 1WEEKDAY ( 'Date'[Date], 2 )
WEEKNUMweek of the year; return type 21 is ISO 8601WEEKNUM ( 'Date'[Date], 21 )
HOUR, MINUTE, SECONDparts of a timeHOUR ( Calls[Start Time] )
Parts of a date

Which functions move dates?

FunctionReturnsExample
EDATEthe date n months later or earlierEDATE ( Contracts[Start], 12 )
EOMONTHthe last day of the month n months awayEOMONTH ( Invoices[Date], 0 )
Moving dates

EOMONTH ( date, 0 ) is the end of the same month, EOMONTH ( date, -1 ) + 1 the first day of it.

Which functions measure between dates?

FunctionReturnsExample
DATEDIFFintervals between two dates: SECOND to YEARDATEDIFF ( Orders[Order Date], Orders[Ship Date], DAY )
YEARFRACthe fraction of a year between two datesYEARFRAC ( Employees[Birth Date], TODAY ( ) )
NETWORKDAYSworking days between two dates, optional weekend and holidaysNETWORKDAYS ( Tickets[Opened], Tickets[Closed], 1, Holidays )
Differences
-- calculated column: age in whole years
Age = INT ( YEARFRAC ( Customer[Birth Date], TODAY ( ) ) )

-- measure: average days to ship
Avg Days to Ship =
AVERAGEX ( Orders, DATEDIFF ( Orders[Order Date], Orders[Ship Date], DAY ) )

-- measure: days since the customer's last order
Days Since Last Order =
DATEDIFF ( CALCULATE ( MAX ( Sales[Order Date] ) ), TODAY ( ), DAY )

NETWORKDAYS takes a weekend code (1 is Saturday and Sunday) and a table of holiday dates.

Which functions return the current time?

FunctionReturns
TODAYthe current date
NOWthe current date and time
UTCTODAYthe current date in UTC
UTCNOWthe current date and time in UTC
Now

Microsoft notes that in the Power BI service the result of NOW is always in UTC, so a report in Vienna sees a time one or two hours behind; near midnight TODAY can also be a different day than the reader expects. Add the offset yourself if local time matters. In calculated columns they are evaluated at refresh, not when the report is viewed.

What goes wrong?

  • Text dates. "29/10/2026" may be read as month 29 in another locale; convert in Power Query with a locale.
  • WEEKNUM default. The default counts weeks from 1 January with Sunday start; use 21 for ISO weeks.
  • DATEDIFF across midnight with times. DAY counts calendar day boundaries, not 24-hour periods.
  • TODAY in columns. A column with TODAY is frozen at the last refresh.

Where can you check this?

Where do you start?

Use CALENDAR with ADDCOLUMNS for your date table and DATEDIFF for durations. Time intelligence functions take it from there.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.