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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
PomJack
Frequent Visitor

Resetting counter after conditions are met

Hi Power BI community,

 

I am trying to count the number for events that different fixtures have over the life of the fixture as measured by date and number of hits on the fixture. When the fixture is worn out, it is repaired and the number of hits resets. I am currently using this function below to calcaulte the running count for each die. It works until the die hits is reset, and then it does not calculate the count as I would like. 

 

Event Count =
COUNTROWS(
    FILTER('Errors',
    'Errors'[Die] = EARLIER([Die]) &&
    'Errors'[Die Hits] <= EARLIER('Errors'[Die Hits]) &&
    'Errors'[Date] <= EARLIER('Errors'[Date])
    ))

 

EventDieDateDie HitsEvent Count (Current)Event Count (Ideal)
AX8/1/2420511
AX8/2/2430022
AX8/3/2433033
BY8/3/24140011
BY8/4/24145622
AX8/5/2450044
BX8/6/2421021
AX8/6/2424032
AX8/7/2431033

 

My second part to this question, is how would I go about displaying just information from the most recent reset for each fixture in report view. Ultimately, I want to display this information in a graph similar to the one below.

 

PomJack_1-1724763909446.png

 

 

1 REPLY 1
lbendlin
Super User
Super User

First part - DAX does not support conditional accumulations. The only tool I know of that can do that is Power Query's List.Accumulate.

 

Second part is actually easier. You can use a measure to identify the last reset point and then suppress everything before that point.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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