Reputation: 3
I need a DAX measure that will return the percentage of the sales diff on 2019%
So if in the slicer we choose in the slicer year 2021, and in the slicer for month we choose January and February, we will need to get that period vs same period 2019 in %. If we choose in the slicers 2019 Jan and Feb we should get 0 for sales vs 2019.
I cannot create calculated columns. I am only available to create calculated measures. I have Period[Date], [year],[month], month number.. table and a Sales table.
Any assistance or guidance please !
Upvotes: 0
Views: 787
Reputation: 7891
You can use the PARALLELPERIOD
function:
Sales % of 2 years ago =
VAR SalesThisYear =
MySalesMeasure
VAR Sales2YearsAgo =
CALCULATE (
MySalesMeasure,
PARALLELPERIOD ( MyDateTable[Date], -2, YEAR )
)
RETURN
DIVIDE (
SalesThisYear,
Sales2YearsAgo
)
Use your table / column names, and existing Sales measure, as required
Upvotes: 1