Time intelligence in DAX enables period-over-period analysis using functions such as TOTALYTD, TOTALMTD, TOTALQTD, SAMEPERIODLASTYEAR, DATEADD, PARALLELPERIOD, PREVIOUSMONTH, and the DATES* family. Each of these requires a properly marked date table containing a continuous date column. Without marking, functions like TOTALYTD may produce incorrect results because the engine cannot identify the calendar backbone of the model. The Power BI auto-date feature creates hidden date tables for each date column but increases model size, so it is generally recommended to disable auto-date and build an explicit date table using CALENDAR, CALENDARAUTO, or GENERATESERIES.
TOTALYTD evaluates an expression from the start of the calendar year up to the latest date in the current filter context, optionally allowing a fiscal year-end date. DATESYTD is the underlying table function, returning a single-column table of dates from the year to date, and is typically wrapped inside CALCULATE. TOTALMTD and DATESMTD perform the same role for month-to-date calculations, while TOTALQTD and DATESQTD handle quarter-to-date scenarios. DATESBETWEEN provides more flexibility by returning dates between any specified start and end, useful for custom periods not aligned with the calendar. OPENINGBALANCEMONTH and CLOSINGBALANCEQUARTER evaluate expressions at the start or end of a period, supporting stock or inventory measures that need snapshots.
For comparing periods, SAMEPERIODLASTYEAR shifts the current date selection back by exactly one year and is the simplest year-over-year tool. DATEADD shifts a date column by a specified number of intervals (days, months, quarters, or years) and is more flexible, while PARALLELPERIOD returns a contiguous range at a specified grain and supports fiscal year shifts. The difference between SAMEPERIODLASTYEAR and DATEADD lies in how they handle non-contiguous selections: SAMEPERIODLASTYEAR shifts every date individually, whereas DATEADD treats the current selection as a unit. Choosing the right function depends on whether the underlying selection represents a single contiguous period or a custom range of dates.