0
votes

I need to calculate a running total of a measure by date and by source. Below is a screenshot how my table looks like now.

Measure by date and by source

Below is the measure code.

CashPosition_Revenue Running Total = CALCULATE([CashPosition_Revenue],FILTER(VALUES(FilterKeys_Date[Date]), FilterKeys_Date[Date] <= MAX(FilterKeys_Date[Date])))

I need last column to be calculated as running total.

1
can I ask what result to do you expect, what is your running total formula or logic?AnkUser
I expect to see every row should be the sum of all above rows.Osman Elsoz

1 Answers

0
votes

Using Values limits your filter context to the current date only, try using All to remove that filter:

CashPosition_Revenue Running Total = 
    VAR CurrentDate = MAX(FilterKeys_Date[Date])
   RETURN 
   CALCULATE(
        SUM(FilterKeys_Date[CashPosition_Revenue]),
        FILTER(
            ALL('FilterKeys_Date'),
            FilterKeys_Date[Date] <= CurrentDate
            )
        )