Forum Discussion
akhassim
2 years agoNew Member
undefined
I need to calculate a cumulative total. How do I do this
ChiragGarg2512
2 years agoSolution Sage
akhassim , If the requirement is to continue addition even when the year ends, so the dax will work some thing like this
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[Date])))
Cumm Based on Date = CALCULATE([Net], Window(1,ABS,0,REL, ALL('date'[date]),ORDERBY('Date'[date],ASC)))
If the sum has to reset every year, the dax will work something like this:
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
Thank You.