Syntax
DATEADD(<dates>,<number_of_intervals>,<interval>)
Tutorial with example
DATEADD is a really useful function to create sets of dates backwords or forward from a point in time. It is used for Previous date calculations.
In this video, I show you how it works.
Link to DAX Studio: https://daxstudio.codeplex.com/
Download example file:
Link to YTD video and Power BI file: https://www.youtube.com/watch?v=5WGOTsYngCI
Example 2: Parallelperiod vs Dateadd
PARALLELPERIOD VS DATEADD DAX functions
Remarks
The dates argument can be any of the following:
- A reference to a date/time column,
- 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.
The result table includes only dates that exist in the dates column.
If the dates in the current context do not form a contiguous interval, the function returns an error.
This DAX function is not supported for use in DirectQuery mode.
Need more examples to practice?
Comparing periods is something you should always do as it adds context to your data, but how do you calculate Same period last month?
PREVIOUSMONTH function will give you the entire previous month, so how do you do it?
Leave a Reply