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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
G0ggs
Helper I
Helper I

How to get running total to stop 45 days ago as there is no data after this point

Hello I have a running total quick measure which is calculating a running total however there is no data after 45 days ago but the running total is still calculating a flat line up to today. 

 

How do I stop the running total 45 days ago instead of running to today please?

 

SORRate running total in Date 2 =
CALCULATE(
    SUM('vwP6ReportAll'[SORRate]),
    FILTER(
        ALLSELECTED('Date'[Date]),
        ISONORAFTER('Date'[Date], MAX('Date'[Date]), DESC)
    )
)
 
Thanks,
Gordon 
2 ACCEPTED SOLUTIONS

Try:
= IF(SELECTEDVALUE('Date'[Date])<=TODAY()-45,
   CALCULATE(
    SUM('vwP6ReportLatest'[Allocation Rate post RWO]),
    FILTER(
        ALLSELECTED('Date'[Date]),
        ISONORAFTER('Date'[Date], MAX('Date'[Date]), DESC)
    )
  )
)

View solution in original post

HarishKM
Memorable Member
Memorable Member

@G0ggs  Hey ,
You can use this one 

SORRate running total in Date 2 =
if(SUM('vwP6ReportAll'[SORRate])<>0,CALCULATE(
    SUM('vwP6ReportAll'[SORRate]),
    FILTER(
        ALLSELECTED('Date'[Date]),
        ISONORAFTER('Date'[Date], MAX('Date'[Date]), DESC)
    )
),0
)

Here i am doing if sale is other than 0 then only calculate otherwise show 0 as output.


View solution in original post

7 REPLIES 7
HarishKM
Memorable Member
Memorable Member

@G0ggs  Hey ,
You can use this one 

SORRate running total in Date 2 =
if(SUM('vwP6ReportAll'[SORRate])<>0,CALCULATE(
    SUM('vwP6ReportAll'[SORRate]),
    FILTER(
        ALLSELECTED('Date'[Date]),
        ISONORAFTER('Date'[Date], MAX('Date'[Date]), DESC)
    )
),0
)

Here i am doing if sale is other than 0 then only calculate otherwise show 0 as output.


halfglassdarkly
Responsive Resident
Responsive Resident

You can just wrap your CALCULATE statement inside an IF statement that checks if max('Date'[Date] is <= [stop date]

 

return your calculation if true, with no false option set.

 

 

Em I am struggling with how to write that formula? The stop date is always changing as it is just 45 days in the past. 

Allocation Rate post RWO running total in Date =
IF
'Date' = Date - 45
Blank(),
CALCULATE(
    SUM('vwP6ReportLatest'[Allocation Rate post RWO]),
    FILTER(
        ALLSELECTED('Date'[Date]),
        ISONORAFTER('Date'[Date], MAX('Date'[Date]), DESC)
    )
)
 
Something like that? 

Try:
= IF(SELECTEDVALUE('Date'[Date])<=TODAY()-45,
   CALCULATE(
    SUM('vwP6ReportLatest'[Allocation Rate post RWO]),
    FILTER(
        ALLSELECTED('Date'[Date]),
        ISONORAFTER('Date'[Date], MAX('Date'[Date]), DESC)
    )
  )
)

Awesome thanks very much that worked!

Cheers

TomMartens
Super User
Super User

Hey @G0ggs ,

 

please create a pbix file that contains sample data but still reflects your data model (tables, relationships, columns, calculated columns, and measures). Upload the file to onedrive or dropbox and share the link. If you are using Excel to create the sample data instead of the manual input method share the xlsx as well.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Sorry it's sensitive info so can't upload 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.