Forum Discussion

ingvarp's avatar
ingvarp
Frequent Visitor
3 years ago
Solved

Cumulative Bank Balance

Hello Everyone,

 

I want to create a measure that calculates the company´s bank balance. 

 

So far, I have used the following code:

 

Cumulative Bank Balance  =
CALCULATE( [ 10122 Amount],
    FILTER(
ALLSELECTED('Date'),
    'Date'[Date] <= MAX('Date'[Date] ))
)
 
which works fine if I want to show the value on a card (current bank balance) or on a visual that starts from the very beginning.
 
But, if I want to see the last year and choose 2023 from the filter, it does not consider the closing balance from 2022 and therefore does show an incorrect value. 
 
Please help me to create a measure that calculates the cumulative amount even if I change the year or month from the filters.
 
Thank you so much!
 
 
 

1 Reply