5.3 Time Intelligence Measures
Key Takeaways
- Time intelligence functions require a proper Date table marked as such with no gaps and unique dates.
- TOTALYTD, TOTALQTD, and TOTALMTD calculate running totals for year, quarter, and month to date.
- SAMEPERIODLASTYEAR returns the same date range shifted back one year for year-over-year comparisons.
- DATEADD shifts dates by a specified interval (day, month, quarter, year) for flexible period comparisons.
- PARALLELPERIOD returns the full parallel period (entire month/quarter/year) rather than a partial period.
Time Intelligence Measures
Quick Answer: Time intelligence DAX functions enable period-over-period analysis (YTD, YoY, QTD, moving averages). They ALL require a proper Date table marked as the date table. Key functions: TOTALYTD for year-to-date, SAMEPERIODLASTYEAR for same-period-last-year, DATEADD for flexible period shifts, and PARALLELPERIOD for full parallel periods.
Prerequisites
Time intelligence functions require a properly configured Date table:
- ✅ Table marked as Date Table (Table Tools → Mark as Date Table)
- ✅ Date column with Date data type
- ✅ No gaps in the date range (contiguous dates)
- ✅ Unique values (one row per date)
- ✅ Covers all dates in related fact tables
Critical: If any of these requirements are not met, time intelligence functions will produce incorrect results or errors.
Year-to-Date (YTD)
TOTALYTD
Revenue YTD =
TOTALYTD(SUM(Sales[Amount]), 'Date'[Date])
Equivalent to:
Revenue YTD =
CALCULATE(
SUM(Sales[Amount]),
DATESYTD('Date'[Date])
)
Custom fiscal year end:
// Fiscal year ending June 30
Revenue Fiscal YTD =
TOTALYTD(SUM(Sales[Amount]), 'Date'[Date], "6/30")
Quarter-to-Date and Month-to-Date
Revenue QTD =
TOTALQTD(SUM(Sales[Amount]), 'Date'[Date])
Revenue MTD =
TOTALMTD(SUM(Sales[Amount]), 'Date'[Date])
Year-Over-Year Comparisons
SAMEPERIODLASTYEAR
Returns the same date range from one year prior:
Revenue Last Year =
CALCULATE(
SUM(Sales[Amount]),
SAMEPERIODLASTYEAR('Date'[Date])
)
Year-Over-Year Change (Amount)
YoY Change =
VAR CurrentPeriod = SUM(Sales[Amount])
VAR PriorPeriod =
CALCULATE(
SUM(Sales[Amount]),
SAMEPERIODLASTYEAR('Date'[Date])
)
RETURN
CurrentPeriod - PriorPeriod
Year-Over-Year Change (Percentage)
YoY % Change =
VAR CurrentPeriod = SUM(Sales[Amount])
VAR PriorPeriod =
CALCULATE(
SUM(Sales[Amount]),
SAMEPERIODLASTYEAR('Date'[Date])
)
RETURN
DIVIDE(CurrentPeriod - PriorPeriod, PriorPeriod)
DATEADD — Flexible Period Shifts
DATEADD(dates, number_of_intervals, interval) shifts dates by any interval:
// Revenue from 1 year ago
Revenue Prev Year =
CALCULATE(SUM(Sales[Amount]), DATEADD('Date'[Date], -1, YEAR))
// Revenue from 1 quarter ago
Revenue Prev Quarter =
CALCULATE(SUM(Sales[Amount]), DATEADD('Date'[Date], -1, QUARTER))
// Revenue from 1 month ago
Revenue Prev Month =
CALCULATE(SUM(Sales[Amount]), DATEADD('Date'[Date], -1, MONTH))
// Revenue from 7 days ago
Revenue Prev Week =
CALCULATE(SUM(Sales[Amount]), DATEADD('Date'[Date], -7, DAY))
DATEADD vs. SAMEPERIODLASTYEAR:
SAMEPERIODLASTYEAR=DATEADD(dates, -1, YEAR)— they are equivalentDATEADDis more flexible (any number of intervals, any direction)
PARALLELPERIOD vs. DATEADD
| Function | Behavior | Example (March 15, 2026) |
|---|---|---|
| DATEADD(-1, MONTH) | Shifts the current selection back | Feb 15, 2026 (partial month) |
| PARALLELPERIOD(-1, MONTH) | Returns the FULL parallel period | Feb 1-28, 2026 (full month) |
// Full previous month revenue
Revenue Full Prev Month =
CALCULATE(
SUM(Sales[Amount]),
PARALLELPERIOD('Date'[Date], -1, MONTH)
)
Running Totals and Moving Averages
Running Total (Cumulative)
Running Total =
CALCULATE(
SUM(Sales[Amount]),
FILTER(
ALL('Date'),
'Date'[Date] <= MAX('Date'[Date])
)
)
3-Month Moving Average
Moving Avg 3M =
AVERAGEX(
DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -3, MONTH),
CALCULATE(SUM(Sales[Amount]))
)
Other Time Intelligence Functions
| Function | Purpose |
|---|---|
| FIRSTDATE / LASTDATE | First/last date in the current filter context |
| STARTOFMONTH / ENDOFMONTH | First/last day of the month |
| STARTOFQUARTER / ENDOFQUARTER | First/last day of the quarter |
| STARTOFYEAR / ENDOFYEAR | First/last day of the year |
| PREVIOUSMONTH / NEXTMONTH | Full date range for previous/next month |
| PREVIOUSQUARTER / NEXTQUARTER | Full date range for previous/next quarter |
| PREVIOUSYEAR / NEXTYEAR | Full date range for previous/next year |
| DATESBETWEEN | Custom date range between two dates |
| DATESINPERIOD | N intervals back from a reference date |
Common Time Intelligence Patterns
Full Comparison Dashboard
Revenue = SUM(Sales[Amount])
Revenue PY =
CALCULATE([Revenue], SAMEPERIODLASTYEAR('Date'[Date]))
Revenue YTD =
TOTALYTD([Revenue], 'Date'[Date])
Revenue PY YTD =
CALCULATE([Revenue YTD], SAMEPERIODLASTYEAR('Date'[Date]))
YoY Growth =
DIVIDE([Revenue] - [Revenue PY], [Revenue PY])
YTD Growth =
DIVIDE([Revenue YTD] - [Revenue PY YTD], [Revenue PY YTD])
On the Exam
The PL-300 frequently tests:
- Date table requirements for time intelligence to work
- TOTALYTD/QTD/MTD for period-to-date calculations
- SAMEPERIODLASTYEAR for year-over-year comparisons
- Difference between DATEADD and PARALLELPERIOD
- Creating YoY change (both absolute and percentage)
Which of the following is NOT a requirement for time intelligence functions to work correctly?
What is the difference between DATEADD('Date'[Date], -1, MONTH) and PARALLELPERIOD('Date'[Date], -1, MONTH) when the current filter is March 15, 2026?
Write a measure to calculate year-to-date revenue with a fiscal year ending March 31. Which formula is correct?