12 rolling averages but doesn't it display 12 periods back based on chosen period from slicer

Could you please help …
I have a measure :

12-AVG_roll =
AVERAGEX(
DATESINPERIOD(
(‘DIM_TIME_DAY’[OP_DATE]),
LASTDATE(‘DIM_TIME_DAY’[OP_DATE]) ,
-1 ,
YEAR),
CALCULATE([Total_Events])

        )

My problem that my chart doesn’t change when I change period is slicer. I need to have 12 months back displayed from chosen period on slicer. I couldn’t find any solution for me so would be grateful for help. PBI attached.

Iwona

no file attached :frowning:

problem - Copy.pbix (257.1 KB)

Could it be a solution ? creating a copy of date table and plot it into measure