Forum Discussion
cumulative sum
- 9 years ago
MEASURE 1
Running Total = CALCULATE ( SUM ( financials[actuals] ), FILTER ( ALLSELECTED ( financials ), financials[month] <= MAX ( financials[month] ) && MIN ( financials[month] ) <= TODAY () ) )Measure 1 will give you the RT up to today - however you may still overshoot a bit if there's no data for the current month.
So to address this you may want to use Measure 2.
MEASURE 2
Running Total 2 = IF ( MIN ( financials[month] ) <= CALCULATE ( LASTDATE ( financials[month] ), FILTER ( ALLSELECTED ( financials ), financials[actuals] <> BLANK () ) ), CALCULATE ( SUM ( financials[actuals] ), FILTER ( ALLSELECTED ( financials ), financials[month] <= MAX ( financials[month] ) ) ) )Good Luck! :smileyhappy:
According to your description, you may need some measure as below. Check more details in the attached pbix.
cumulative SUM = SUMX(FILTER(ALLSELECTED(financials),financials[month]<=MAX(financials[month])),financials[actuals])
If it is not exactly what you're requiring, please elaborate with more details, even better with a sample pbix.
- Nikki9 years agoHelper II
thanks this is great, but how do i display cumualtive actuals though purely based on what is entered. i have forecast values till end of 2017 for each month, the report shows cumulative actuals till end of year too ..i need the cumulative actuals to stop based on when it was last entered..
- Sean9 years agoCommunity Champion
MEASURE 1
Running Total = CALCULATE ( SUM ( financials[actuals] ), FILTER ( ALLSELECTED ( financials ), financials[month] <= MAX ( financials[month] ) && MIN ( financials[month] ) <= TODAY () ) )Measure 1 will give you the RT up to today - however you may still overshoot a bit if there's no data for the current month.
So to address this you may want to use Measure 2.
MEASURE 2
Running Total 2 = IF ( MIN ( financials[month] ) <= CALCULATE ( LASTDATE ( financials[month] ), FILTER ( ALLSELECTED ( financials ), financials[actuals] <> BLANK () ) ), CALCULATE ( SUM ( financials[actuals] ), FILTER ( ALLSELECTED ( financials ), financials[month] <= MAX ( financials[month] ) ) ) )Good Luck! :smileyhappy: