Forum Discussion
Lauco
5 years agoNew Member
Total Cumulative Sale Last year
Hello, I am trying to compare total cumulative this year vs total cumulative last year. For this year it works perfectly well but when i am introducting the formula same period last year, i...
- 5 years ago
Hi Lauco ,
You can try the following measure:
TotalsalesCy = CALCULATE(SUM('Table'[Sales]),FILTER(ALL('Date'),'Date'[Date]<=MAX('Date'[Date])&&YEAR('Date'[Date]) = YEAR(MAX('Date'[Date])))) TotalsalesLY = CALCULATE(SUM('Table'[Sales]),SAMEPERIODLASTYEAR(CALCULATETABLE(VALUES('Date'[Date]),FILTER(ALL('Date'),'Date'[Date]<=MAX('Date'[Date])&&YEAR('Date'[Date]) = YEAR(MAX('Date'[Date])))))) or you can use the following measure for last year cumulative sales: Lysales = CALCULATE([TotalsalesCy],SAMEPERIODLASTYEAR('Date'[Date]))If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Lauco
5 years agoNew Member
Thank you amitchandak , when i tried to apply the suggested formula i m getting the following errors message "too few arguments for the DATEADD function. The minimal number of argument for this function is 3' Do you see any errors i could have done in my formula ?
Total **bleep** Sales LY = CALCULATE([Total cumulé de pbi_sales_displayed],FILTER(ALLSELECTED('Date orders'),'Date orders'[Date]<=max('Date orders', DATEADD('Date orders'[Date]),-1,YEAR)))