Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

12 M rolling per customer

Dear All, I have this dataset bellow (filtered per customer)


 

I am trying to create a column where the cumulated sales YTD starting from last year date, so there will be a total of sales from last 12 months. I have tried some formulas, but somehow I can't succeed where I am looking for.

 

In column 12M I have added formula: 

CALCULATE(Sum('DSO Sales PDF'[Sales]),DATESBETWEEN('DSO Sales PDF'[Dateformat],NEXTDAY(SAMEPERIODLASTYEAR('dDate Sales'[Month+Year])),LASTDATE('dDate Sales'[Month+Year])))
But somehow it just picks the sales from the starting month.

In column individual sales I have added formula: 
individual Sales = (CALCULATE(SUM('DSO Sales PDF'[Sales]),ALLEXCEPT('DSO Sales PDF','DSO Sales PDF'[Customer])))
 
This calculates the total sales from one customer, so I have tried to add a filter on this formula which could pickup de sales from last 12 months.
 
Can someone help me to get the correct formula?
 
Thanks!
Ramon
 

4 Replies