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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.