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
LaurenceSD
Advocate II
Advocate II

Running Total - Resets with Date Filter

Hi,

 

I've got a formula for calculating a running total which is this

 

Bookings This Year Running Total =
if(max(Dates[Date])<=today(),
CALCULATE(
    [Bookings This Year],
    FILTER(
        ALLSELECTED('Dates'[Date]),
        ISONORAFTER('Dates'[Date], MAX('Dates'[Date]), DESC)
    )
),BLANK())
 
The problem I've got is when I use a date slicer, the count doesn't reset, is there a way I can modify this formula, so that when i select a FY and a month, that the start value rests to 0, so in the below example, instead of 1st Jan 2024 representing the 39,134th booking ever, it would said say 2 & 23rd January 2024 would say 458
 
LaurenceSD_0-1706030332746.png

The dataset used in this report is massive, so hard for me to upload, but if needed I can try and create a smaller replica

 

Thanks

3 REPLIES 3
Daniel29195
Super User
Super User

hello @LaurenceSD 

modification to your code : 

Bookings This Year Running Total =
var min_date =  calculate(min(dates[date]),  allselected(dates[date]))
var max_date = max(dates[date])
if(max(Dates[Date])<=today(),
CALCULATE(
    [Bookings This Year],
all(dates[date]) ,
  dates[date] <=max_date  , 
dates[date] > = min_date
)
 
),BLANK())
 
 
 
 
let me know if you need any other help
 
 
 
If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. Dont forget to hit that  thumbs up button 🫡👍
LaurenceSD
Advocate II
Advocate II

Bookings This Year is simply a countrows formula, labeled as This Year for ease (I then have LY, LY-1, LY-2, etc coming off with SAMEPERIODLASTYEAR) but nothing clever going on with it.

 

I'll check out the video looks useful, thanks

Greg_Deckler
Community Champion
Community Champion

@LaurenceSD What is the formula for Bookings This Year? You could give BRT a shot. 

Better Running Total - Microsoft Fabric Community

At least that way you could actually troubleshoot what was going on. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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
Top Kudoed Authors