DATEADD
The dates in the filter context moved forward or back by a number of days, months, quarters or years (with a calendar, weeks too).
Group: Time intelligence. Compatible with DAX.
Syntax
DATEADD ( <dates>, <number_of_intervals>, <interval> [, <extension>] [, <truncation>] )
| Parameter | Type | Description |
|---|---|---|
dates | Dates | A column of dates of the model, such as Sales[Month], or the name of a calendar defined in the model. |
number_of_intervals | Whole number | How many intervals to move: forward when positive, back when negative. A fraction is rounded, halves away from zero. |
interval | Keyword | DAY, MONTH, QUARTER or YEAR; with a calendar that has weeks, WEEK too. |
extension | Keyword optional | With a calendar only: what a shift into a longer period takes. EXTENDING (when left out) adds the rest of the longer period, PRECISE keeps to the same place, ENDALIGNED moves a period's end to the other period's end. |
truncation | Keyword optional | With a calendar only: what a shift into a shorter period does with a place it lacks. BLANKS (when left out) leaves it out, ANCHORED takes the period's last date instead. |
Returns
Table. The dates of the filter context moved by the intervals, as far as the column holds them.
Remarks
- Given a column, it reads the dates visible in the current filter context; in a row context, such as
ADDCOLUMNS, the row becomes a filter first, so each row sees its own dates. - A date moved by months keeps its day where it can, else takes the month's last day: 31 January plus a month is 28 February. When the selection covers the column's first to last date of a month, the whole target month comes back: all of March moved back is all of February.
- Only dates the column holds come back: a date the move or the period lands on that the column lacks is left out, and when none is left the table is empty. A business day moved onto a weekend is left out (the second example).
- The selection must be one unbroken run of the column's dates. One with gaps, such as January and March without February, is an error, except on a complete calendar column (one row for every day from the first to the last, no times), where each run moves on its own.
- To compare with the same period a year before,
SAMEPERIODLASTYEARsays the same asDATEADD ( dates, -1, YEAR );PARALLELPERIODmoves whole months, quarters or years instead.
Examples
The month before and the year before
EVALUATE
ADDCOLUMNS (
DATESBETWEEN ( Sales[Month], DATE ( 2025, 1, 1 ), DATE ( 2025, 3, 1 ) ),
"Liters", [Liters sold],
"Month before", CALCULATE ( [Liters sold], DATEADD ( Sales[Month], -1, MONTH ) ),
"Year before", CALCULATE ( [Liters sold], DATEADD ( Sales[Month], -1, YEAR ) )
)
ORDER BY Sales[Month]
| Sales[Month] | Liters | Month before | Year before |
|---|---|---|---|
| 2025-01-01 | 44635 | 50415 | 42637 |
| 2025-02-01 | 44831 | 44635 | 41966 |
| 2025-03-01 | 43593 | 44831 | 43893 |
Business days moved back a month
14 to 18 September 2026, a Monday to a Friday. A month back, 15 and 16 August are a weekend that the column does not hold.
EVALUATE
CALCULATETABLE (
DATEADD ( Prices[Date], -1, MONTH ),
DATESBETWEEN ( Prices[Date], DATE ( 2026, 9, 14 ), DATE ( 2026, 9, 18 ) )
)
ORDER BY Prices[Date]
| Prices[Date] |
|---|
| 2026-08-14 |
| 2026-08-17 |
| 2026-08-18 |
A selection with a gap
January and March 2025 without February: Sales[Month] is no complete calendar, so the call is an error.
EVALUATE
CALCULATETABLE (
DATEADD ( Sales[Month], -1, MONTH ),
FILTER ( ALL ( Sales[Month] ), Sales[Month] = DATE ( 2025, 1, 1 ) || Sales[Month] = DATE ( 2025, 3, 1 ) )
)
Result: an error.
Related functions
SAMEPERIODLASTYEAR, PARALLELPERIOD, DATESINPERIOD, EDATE, CALCULATE.