DAX function
DATEADD — DAX function reference
Shift by an interval.
Syntax
dax
DATEADD(<dates>, <number_of_intervals>, <interval>)
Examples
dax
CALCULATE(SUM(Sales[Amount]), DATEADD('Date'[Date], -1, MONTH))→ Prior-month value
dax
CALCULATE(SUM(Sales[Amount]), DATEADD('Date'[Date], -7, DAY))→ Value 7 days earlier — a rolling day-over-day comparison
dax
VAR Current = SUM(Sales[Amount])
VAR PriorQuarter = CALCULATE(SUM(Sales[Amount]), DATEADD('Date'[Date], -1, QUARTER))
RETURN Current - PriorQuarter→ Quarter-over-quarter variance
Common mistakes & gotchas
- The interval argument accepts only YEAR, QUARTER, MONTH, or DAY — there is no WEEK; build a weekly shift with DATEADD(…, -7, DAY) or use DATESINPERIOD.
- DATEADD shifts the entire set of dates currently in context, preserving partial-period selections — different from PARALLELPERIOD, which always snaps to the full period regardless of what’s selected.
Related DAX functions
From Time intelligence