Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ingvarp
Frequent Visitor

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 ACCEPTED SOLUTION
johnt75
Super User
Super User

Change ALLSELECTED to ALL.

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

Change ALLSELECTED to ALL.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.