You have a Sales table with a Date column and a SalesAmount column. You want to create a measure that calculates total sales for the previous month using the DATEADD function.
Which of the following DAX measures correctly calculates the previous month's sales?
Remember, DATEADD shifts the dates by the number of intervals you specify. Negative values move backward in time.
Option D correctly uses DATEADD to shift the date context by -1 month, calculating sales for the previous month. Option D shifts forward by one month, option D shifts by year instead of month, and option D uses a different function (PREVIOUSMONTH) which is valid but not the DATEADD function asked for.
You want to create a line chart showing total sales for the current quarter and the same quarter last year. You have a measure using DATEADD to shift the date by -4 quarters.
Which visual setup best helps compare these two periods clearly?
To compare two time periods, a line chart with both measures helps see trends side by side.
Option A allows clear comparison of current and shifted sales over time. Other options do not show both periods or are not suitable for time series comparison.
Your date table has missing dates for weekends. You use DATEADD to shift sales by one month. What problem can occur and how to fix it?
Think about how DATEADD works with continuous date ranges.
DATEADD requires a continuous date column to shift periods correctly. Missing dates cause blanks in shifted results. Adding all dates including weekends to the date table fixes this.
You want to create a measure that calculates sales for the same period last year but only for a specific product category. Which DAX measure correctly applies the filter and uses DATEADD?
Filters inside CALCULATE can be table filters or filter expressions. Use FILTER for row context filters.
Option A correctly applies DATEADD for time shift and FILTER to restrict category within CALCULATE. Option A uses a boolean filter which is invalid syntax. Option A applies FILTER on ALL(Sales) which removes context incorrectly. Option A adds a table filter outside CALCULATE which is invalid.
You have a fiscal calendar starting in April. You use DATEADD to shift sales by -1 year, but the results do not align with fiscal years. What is the likely cause?
Think about how DATEADD interprets the date column and fiscal calendars.
DATEADD shifts dates based on the actual dates in the date column, which follow calendar years by default. To align with fiscal years, you need a date table that reflects fiscal periods and use it in your model and calculations.