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
Akmp
Frequent Visitor

Counting consecutive fails in test results

I have a table containing test results.

The test results contain Buildnr, TestCase name and TestCase results.

image.png

I want to create a new measure or a new column which calculates how many times a testcase has failed in a row.

e.g if i specify Build and TestCase it should show that the Test Case has failed x times in a row.

Build 125

TC_1 -> 3 fails in a row

TC_2 -> 2 fails in a row

TC_3 -> first failure

TC_4 -> No fails

 

One solutions would be to create a new table where which contains a matrix where the columns are TestCase names and The Rows Build_nr.  But i do not know how to do that.

 

What is the prefered way to find consecutive failures?

1 ACCEPTED SOLUTION
Akmp
Frequent Visitor
2 REPLIES 2
Akmp
Frequent Visitor
v-eachen-msft
Community Support
Community Support

Hi @Akmp ,

 

You can create a new calculated column to mark the “Fail” and “Pass”.

Column 2 =
VAR a =
    CALCULATE (
        COUNTROWS ( FILTER ( test, test[Result] = "fail" ) ),
        ALLEXCEPT ( test, test[TestCase], test[Build] )
    )
RETURN
    IF ( a = BLANK (), 0, a )

Then you can refer to this case which is similar to yours.
https://community.powerbi.com/t5/Desktop/DAX-how-to-count-consecutive-identical-values/td-p/701936

 

Best Regards,

Eads

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

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