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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Calculation of running total with conditions

Hi all,
I am in need of experts help here.

I want to build a measure for running total balance.
But I have conditions here.
I want that if the running total is less then 150,000 it will show me 150,000
and I want that if it excceds 800,000 it will stop there and show me only 800,000
And here is the problem.
I Made the Running total calculation but I can't find a way to cause the calculation to "delete" all previous calculations and start it over from 150,000 or 800,000.

Here is a how this should look
It starts here with180,000 but it dosent matter. Lets say it starts with 0
Capture.PNG

 



Any help?

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous ,

Cumm Sales =

var _1 = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[Date])))

return 

Switch true() ,

_1 <= 150000, 150000,

_1 >= 800000, 800000,

_1

)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi,

This doesn't work
In my example above in March your solution will give me  -573,543 +30,776 +716,253 = 173,486
And as it above then 150000 and less then 800000 the result will be 173,486

But as you can see the result should be  897,029

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors