0
votes

I am having trouble making a cumulative sum.

It is showing data from the previous column instead of being a cumulative.

I have tested it out on a test file and it works fine but using the same format of the formula:

QuoteValue running total in ClosedDate =

Sales running total in Date = 
CALCULATE(
    SUM('Sheet1'[Sales]),
    FILTER(
        ALLSELECTED('Sheet1'[Date]),
        ISONORAFTER('Sheet1'[Date], MAX('Sheet1'[Date]), DESC)
    )
)

Im not sure what i am doing wrong, ive used ALLSELECTED, FILTER(ALL, ALL

The Quotevalue and Date are both in the same table and all other fields im using in the visual are all in the same table.

Im stumped.

Here is a dummy sheet i have put together.

Dummy Sheet

1

1 Answers

0
votes
Sales running total in Date = 
var person = 'Sheet1'[Person]
var toDate = 'Sheet1'[Date]
return CALCULATE(
    SUM('Sheet1'[Sales]),
        FILTER('Sheet1', 'Sheet1'[Person] = Person && 'Sheet1'[Date] <= toDate)
)

What we do here is that for each row, we get the other rows where persons are same and date is lower or equal. From this we calculate the sum.