Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Running total

Hello all,

 

I've this running total measure:

 

Running Total Ferien Rest =

CALCULATE(
SUM(DIA_SAP_ABSENZEN[Ferien Rest]),
FILTER(
ALLSELECTED(DIA_SAP_ABSENZEN),
DIA_SAP_ABSENZEN[Datum] <= MAX(DIA_SAP_ABSENZEN[Datum])
)
)
 
It gives me the correct running total up to a specific date, or within a specific date range, which is good.
 
However, now I need it to give me the running total for up to any given date, or a date range, which will also include all data since inception. For example, if I choose 2020, then I'd like the remaining balance from 2019/18/17 etc to be icluded, whilst at the moment it only gives me the running total for 2020.
 
Is this doable with this measure, or should I use something else?
  • Anonymous 

    I see that you're using the Date table fields for slicing. That's much better. Try this:

    Measure V4 = 
    VAR max_ =
        MAX ( 'Date'[Date] )
    RETURN
        CALCULATE ( SUM ( Table1[Ferien Rest] ), 'Date'[Date] <= max_, ALL ( 'Date' ) )

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers 

     

11 Replies