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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Joe_Grosskopf
Helper II
Helper II

Reset a running total based on field change

I have a running total working well that looks like this:

 

RT_700Indirect =
            VAR __date = max('Dept 700 Daily Time'[date_began])
            VAR __Table = FILTER(ALLSELECTED('Dept 700 Daily Time'),'Dept 700 Daily Time'[date_began] <= __date )
            return
            sumx(__Table,[Indirect Time])
 
 
I have a department column and I would like the RT to reset to 0 whenever the department changes. How do I add this to the command above?
 
Thank You
7 REPLIES 7
Joe_Grosskopf
Helper II
Helper II

OK, finally back to working on this...this is a link to the file

 

https://jlsautomation-my.sharepoint.com/:u:/p/jgrosskopf/EZazJ__GV-xKkVp6sG-EIiIBmJptiMWmsbj2uK843O-...

 

If you look at the table Dept800-1 Daily Hours you will see a measure RTWeekWorking800-1...I am showing the column as well. It is supposed to be resetting whenever the week changes, but it is not...just continuously adding.

 

Thanks

There is no such table...

 

I would recommend that you rethink your data model. There doesn't seem to be an obvious reason to keep separate departmental tables.  On a separate note - bididrectional 1:1 relationships often mean you can merge the tables.

OK I'll do that but for now can you tell me how to do the RT? I need to get this working quickly

 

Joe_Grosskopf
Helper II
Helper II

Thank you all for the responses....got side tracked on another item but will try this when I get back to this one 

 

Joe_Grosskopf
Helper II
Helper II

 This is an example of what I am trying to do

Screenshot 2022-09-26 074240.jpg

There are many ways to do this, some are subtle, some are more brutal.  Here's a brutal version

 

RT = 
var md = max('Table'[Date])
return CALCULATE(sum('Table'[Hours]),ALLEXCEPT('Table','Table'[Dep]),'Table'[Date]<=md)

lbendlin_0-1664202909519.png

 

lbendlin
Super User
Super User

whenever the department changes

This can mean a lot of things. Please provide sanitized sample data that fully covers your issue.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.