cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Running total until last date (running total doesn't stop..)

Hi,

 

Need help!

I have a cumulative graph has lines from different source.

To put all values with different range of dates, I made a master Calendar.

 

I want to show P running total in date till last date.

Any idea would be appreciated.

Question2.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator v-yuezhe-msft
Moderator

Re: Running total until last date (running total doesn't stop..)

@colourfullife ,

Please add a IF condition in your DAX as shown in the example below, for more details, please check this blog: https://www.daxpatterns.com/cumulative-total/.

running total = 
IF (
    MIN ( 'Date'[Date] )
        <= CALCULATE ( MAX ( Table1[Date] ), ALL ( Table1) ),
    CALCULATE (
        SUM ( Table1[Amount] ),
        FILTER (
            ALL ( 'Date'[Date] ),
            'Date'[Date] <= MAX ( 'Date'[Date] )
        )
    )
)
 



Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 REPLY 1
Moderator v-yuezhe-msft
Moderator

Re: Running total until last date (running total doesn't stop..)

@colourfullife ,

Please add a IF condition in your DAX as shown in the example below, for more details, please check this blog: https://www.daxpatterns.com/cumulative-total/.

running total = 
IF (
    MIN ( 'Date'[Date] )
        <= CALCULATE ( MAX ( Table1[Date] ), ALL ( Table1) ),
    CALCULATE (
        SUM ( Table1[Amount] ),
        FILTER (
            ALL ( 'Date'[Date] ),
            'Date'[Date] <= MAX ( 'Date'[Date] )
        )
    )
)
 



Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.