Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Cumulative graph not working for previous year

Hi there,

 

I have the following graph on my report which looks at cumulative sales for 2019, with the black line supposed to show cumulative sales for the previous year. However, the black line is just showing month to month sales.

 

 

The blue line (current year) uses the following formula:

 

RunningSalesTotal =
CALCULATE(
('key_measure'[Total_sales]),
FILTER (
ALLSELECTED('salesorders'),
'salesorders'[createdon] <= MAX('salesorders'[createdon] )
)
)

 

I'm then using this formula to try and apply the previous year cumulative, but it's not working:

 

PY Cumulative = 
CALCULATE ( [RunningSalesTotal], DATEADD ( 'DIMDate'[Date], -1, YEAR ) )

 

Any ideas much appreciated?

 

Thanks

2 Replies