This is my first time on the forum
I am struggling with this scenario. I am trying to figure out a measure which will enable to visualize Sales from a specific period of time (Eg: month and year ‘Oct 2019’) of that same period of my last 5 years (‘Oct 2018’, (‘Oct 2017’ …) in a graphic chart ( one column value for each year). These values shoud dynamically change when choosing different period (month and year). I mean, if I change the value on the slicer to Sept 2018, graphic will return values for Sept 2017, Sept 2016…. Sept 2014.
I have tried to create a disconnected date table and apply this measure but is is giving me wrong result. It returns all year sales instead of sales for the month selected on the slicer (see pbix attached)
Last 3 years sales = VAR CurrentDate = MAX ( 'Dates Disconnected'[Date] ) VAR PrevDate = DATE ( YEAR ( CurrentDate ); MONTH ( CurrentDate ) -36; DAY ( CurrentDate ) ) VAR Result = CALCULATE ( [Total Sales]; FILTER ( Sales; Sales[OrderDate] >= PrevDate && Sales[OrderDate] <= CurrentDate ) ) RETURN Result
Forum_EnterpiseDNA.pbix (547.1 KB)
Thanks in advanced