DATEADD – DAX Guide (2025)

Syntax | Return values | Remarks | Examples | Articles | Related

Moves the given set of dates by a specified interval.

Syntax

DATEADD ( <Dates>, <NumberOfIntervals>, <Interval> )

Parameter Attributes Description
Dates

The name of a column containing dates or a one column table containing dates.

NumberOfIntervals

The number of intervals to shift.

Interval

One of: Day, Month, Quarter, Year.

Return values

Table A table with a single column.

A table containing a single column of date values.

Notes

In order to use any time intelligence calculation, you need a well-formed date table. The Date table must satisfy the following requirements:

  • All dates need to be present for the years required. The Date table must always start on January 1 and end on December 31, including all the days in this range. If the report only references fiscal years, then the date table must include all the dates from the first to the last day of a fiscal year. For example, if the fiscal year 2008 starts on July 1, 2007, then the Date table must include all the days from July 1, 2007 to June 30, 2008.
  • There needs to be a column with a DateTime or Date data type containing unique values. This column is usually called Date. Even though the Date column is often used to define relationships with other tables, this is not required. Still, the Date column must contain unique values and should be referenced by the Mark as Date Table feature. In case the column also contains a time part, no time should be used – for example, the time should always be 12:00 am.
  • The Date table must be marked as a date table in the model, in case the relationship between the Date table and any other table is not based on the Date.
The result of time intelligence functions has the same data lineage as the date column or table provided as an argument.

Remarks

The dates argument can be any of the following:

  • A reference to a date/time column. Only in this case a context transition applies because the <Dates> column reference is replaced by
    • CALCULATETABLE ( DISTINCT ( <Dates> ) )
  • A table expression that returns a single column of date/time values.
  • A Boolean expression that defines a single-column table of date/time values.

If the number specified for NumberOfIntervals is positive, the dates in dates are moved forward in time; if the number is negative, the dates in dates are shifted back in time.

The result table includes only dates that exist in the dates column.

The result table has an entire month if an entire month is selected in the source table. The notion of “month selected” is based on the dates available in the underlying date table. This way:

  • If the <Dates> argument includes all the days in April (30 rows), the result for the previous month includes all the days in March (31 days).
  • If the <Dates> argument includes the first 15 days in April (15 rows), the result for the previous month includes the first 15 days in March (15 rows).

» 3 related articles
» 1 related function

Examples

-- DATEADD is a more generic functions. -- It shifts a period back and forth over time using -- DAY, MONTH, QUARTER, YEAR-- This example produces the same result as SAMEPERIODLASTYEAREVALUATEVAR StartDate = DATE ( 2008, 07, 25 )VAR EndDate = DATE ( 2008, 07, 31 )RETURN CALCULATETABLE ( DATEADD ( 'Date'[Date], -1, YEAR ), 'Date'[Date] >= StartDate && 'Date'[Date] <= EndDate )ORDER BY [Date]
Date
2007-07-25
2007-07-26
2007-07-27
2007-07-28
2007-07-29
2007-07-30
2007-07-31
-- DATEADD has a quite complex logic to move months and quarters-- the right way, handling months with different dates.EVALUATEVAR StartDate = DATE ( 2008, 02, 25 )VAR EndDate = DATE ( 2008, 02, 29 )RETURN CALCULATETABLE ( DATEADD ( 'Date'[Date], +1, MONTH ), 'Date'[Date] >= StartDate && 'Date'[Date] <= EndDate )ORDER BY [Date]
Date
2008-03-25
2008-03-26
2008-03-27
2008-03-28
2008-03-29
2008-03-30
2008-03-31
-- This example shows the sales in the current and previous month.-- It also reports sales in the same month in the previous quarter and year.DEFINE MEASURE Sales[Same period last month] = CALCULATE ( [Sales Amount], DATEADD ( 'Date'[Date], -1, MONTH ) ) MEASURE Sales[Same period last quarter] = CALCULATE ( [Sales Amount], DATEADD ( 'Date'[Date], -1, QUARTER ) ) MEASURE Sales[Same period last year] = CALCULATE ( [Sales Amount], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )EVALUATESUMMARIZECOLUMNS ( 'Date'[Calendar Year Month Number], 'Date'[Calendar Year Month], "Sales Amount", [Sales Amount], "Same period last month", [Same period last month], "Same period last quarter", [Same period last quarter], "Same period last year", [Same period last year])ORDER BY [Calendar Year Month Number]
Calendar Year Month NumberCalendar Year MonthSales AmountSame period last monthSame period last quarterSame period last year
2007012007-01-01794,248.24(Blank)(Blank)(Blank)
2007022007-02-01891,135.91794,248.24(Blank)(Blank)
2007032007-03-01961,289.24891,135.91(Blank)(Blank)
2007042007-04-011,128,104.82961,289.24794,248.24(Blank)
2007052007-05-01936,192.741,128,104.82891,135.91(Blank)
2007062007-06-01982,304.46936,192.74961,289.24(Blank)
2007072007-07-01922,542.98982,304.461,128,104.82(Blank)
2007082007-08-01952,834.58922,542.98936,192.74(Blank)
2007092007-09-011,009,868.98952,834.59982,304.46(Blank)
2007102007-10-01914,273.541,009,868.98922,542.98(Blank)
2007112007-11-01825,601.87914,273.54952,834.59(Blank)
2007122007-12-01991,548.75825,601.871,009,868.98(Blank)
2008012008-01-01656,766.69991,548.75914,273.54794,248.24
2008022008-02-01600,080.00656,766.69825,601.87891,135.91
2008032008-03-01559,538.52600,080.00991,548.75961,289.24
2008042008-04-01999,667.17559,538.52656,766.691,128,104.82
2008052008-05-01893,231.96999,667.17600,080.00936,192.74
2008062008-06-01845,141.60893,231.96559,538.52982,304.46
2008072008-07-01890,547.41845,141.60999,667.17922,542.98
2008082008-08-01721,560.95890,547.41893,231.96952,834.59
2008092008-09-01963,437.23721,560.95845,141.601,009,868.98
2008102008-10-01719,792.99963,437.23890,547.41914,273.54
2008112008-11-011,156,109.32719,792.99721,560.95825,601.87
2008122008-12-01921,709.141,156,109.32963,437.23991,548.75
2009012009-01-01580,901.05921,709.14719,792.99656,766.69
2009022009-02-01622,581.14580,901.051,156,109.32600,080.00
2009032009-03-01496,137.87622,581.14921,709.14559,538.52
2009042009-04-01678,893.22496,137.87580,901.05999,667.17
2009052009-05-011,067,165.23678,893.22622,581.14893,231.96
2009062009-06-01872,586.201,067,165.23496,137.87845,141.60
2009072009-07-011,068,396.58872,586.20678,893.22890,547.41
2009082009-08-01835,707.461,068,396.581,067,165.23721,560.95
2009092009-09-01709,610.40835,707.46872,586.20963,437.23
2009102009-10-01806,738.22709,610.401,068,396.58719,792.99
2009112009-11-01868,164.01806,738.22835,707.461,156,109.32
2009122009-12-01746,933.50868,164.01709,610.40921,709.14
2010012010-01-01(Blank)746,933.50806,738.22580,901.05
2010022010-02-01(Blank)(Blank)868,164.01622,581.14
2010032010-03-01(Blank)(Blank)746,933.50496,137.87
2010042010-04-01(Blank)(Blank)(Blank)678,893.22
2010052010-05-01(Blank)(Blank)(Blank)1,067,165.23
2010062010-06-01(Blank)(Blank)(Blank)872,586.20
2010072010-07-01(Blank)(Blank)(Blank)1,068,396.58
2010082010-08-01(Blank)(Blank)(Blank)835,707.46
2010092010-09-01(Blank)(Blank)(Blank)709,610.40
2010102010-10-01(Blank)(Blank)(Blank)806,738.22
2010112010-11-01(Blank)(Blank)(Blank)868,164.01
2010122010-12-01(Blank)(Blank)(Blank)746,933.50

Related articles

Learn more about DATEADD in the following articles:

Related functions

Other related functions are:

  • PARALLELPERIOD

DATEADD – DAX Guide (1)

Last update: Jun 14, 2025 » Contribute » Show contributors

Contributors: Alberto Ferrari, Marco Russo

Microsoft documentation: https://docs.microsoft.com/en-us/dax/dateadd-function-dax

2018-2025 © SQLBI. All rights are reserved. Information coming from Microsoft documentation is property of Microsoft Corp. » Contact us

DATEADD  –  DAX Guide (2025)
Top Articles
Latest Posts
Recommended Articles
Article information

Author: Horacio Brakus JD

Last Updated:

Views: 5994

Rating: 4 / 5 (71 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Horacio Brakus JD

Birthday: 1999-08-21

Address: Apt. 524 43384 Minnie Prairie, South Edda, MA 62804

Phone: +5931039998219

Job: Sales Strategist

Hobby: Sculling, Kitesurfing, Orienteering, Painting, Computer programming, Creative writing, Scuba diving

Introduction: My name is Horacio Brakus JD, I am a lively, splendid, jolly, vivacious, vast, cheerful, agreeable person who loves writing and wants to share my knowledge and understanding with you.