DAX DATEADD function

Returns the dates in view, shifted by a number of days, months, quarters or years.

DATEADD moves the period in view forwards or backwards. With -1 and MONTH it gives the previous month, the base of month-over-month measures.

Syntax

DATEADD(<dates>, <number_of_intervals>, <interval>)
ArgumentRequiredDescription
datesRequiredThe date column of your date table.
number_of_intervalsRequiredHow many intervals to move: negative goes back.
intervalRequiredDAY, MONTH, QUARTER or YEAR.

Returns: A table of dates, used as a filter.

Examples

Calculated on the free practice data (table financials), with [Total Sales] = SUM(financials[Sales]) and [Total Profit] = SUM(financials[Profit]).

1. Previous month's sales

Sales PM = CALCULATE([Total Sales], DATEADD(Dates[Date], -1, MONTH))
Month YearSales PM
Sep 2013(blank)
Oct 20134,484,000.03
Nov 20139,295,611.10
Dec 20137,267,203.30
Jan 20145,368,441.08

September 2013 is the first month with data, so it has no previous month.

Good to know

  • Month-over-month change: DIVIDE([Total Sales] - [Sales PM], [Sales PM]).

Related functions

Official reference: DATEADD function on Microsoft Learn