Forum Discussion

ronaldbalza2023's avatar
ronaldbalza2023
Continued Contributor
4 years ago
Solved

Stopping Cumulative Total

Hi everyone, how can I stop my cumulative total on calculating when no actual values on subsequent days/months. I do have my date filtered in Year. Thanks in advance.

Here are my two measures respectively:

Bank Movements (Cummulative) = [Op Bal Interim Bank Transactions] +
CALCULATE( 
	[Bank Movement] , 
	FILTER(
		ALLSELECTED( Dates),
		Dates[Date] <= MAX( Dates[Date])
	)
)

 

Bank Movements (Cumulative) New Measure = 
 IF (
        SELECTEDVALUE ( Dates[Date] ) > [Last Sales Date],
        BLANK (),
        CALCULATE (
            [Bank Movement],
            FILTER ( ALLSELECTED ( Dates ), Dates[Date] <= MAX ( Dates[Date] ) )
        )
    ) + [Op Bal Interim Bank Transactions]
    

 

  • amitchandak's avatar
    amitchandak
    4 years ago

    ronaldbalza2023 , hope in this measure you have not added +0 or handled blank value using if

    Op Bal Interim Bank Transactions

     

    remove +0 or any blank handling

3 Replies

  • ronaldbalza2023 , Try a new measure like

     

    Bank Movements (Cumulative) New Measure =
    var _max = maxx(allselected(Dates),Dates[Date])
    return
    CALCULATE (
    [Bank Movement],
    FILTER ( ALLSELECTED ( Dates ), Dates[Date] <= MAX ( Dates[Date] ) && Dates[Date] <=_max )
    )
    + [Op Bal Interim Bank Transactions]

      • amitchandak's avatar
        amitchandak
        Super User

        ronaldbalza2023 , hope in this measure you have not added +0 or handled blank value using if

        Op Bal Interim Bank Transactions

         

        remove +0 or any blank handling