Forum Discussion

MH3's avatar
MH3
Icon for Helper V rankHelper V
5 years ago
Solved

Sales Running Total/Cumulative Total

Hi, 

I have a Monthly Sales from July to June  and I want to calculate Cumulative total of Every year and it should refresh on July for every year, but the measure is not working like that:

ScreenShot: As you can see The 2009 July units sold is 57,447 but the cumulative total is 947,931 which is not refreshed.

 

Measure: 

 

SALES RT = 
VAR MAXDATE = MAX(DimCalender[Date])
VAR RESULT = 
CALCULATE([Units Sold],
DimCalender[Date] <= MAXDATE,
All(DimCalender)
)
RETURN
RESULT

 


Any Help? 

  • MH3 ,

    You can use that datesytd ?

    YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"6/30"))
    Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"6/30"))

1 Reply

  • MH3 ,

    You can use that datesytd ?

    YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"6/30"))
    Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"6/30"))