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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

DAX Measure

Hi,

 

I am new to Power BI.

 

I want to right the Dax measure to get the count of customers (ID) who succeeds after their 1 attempt. For example, for id 1 the first attempt was an error & if the second or third, etc. attempt was succeeded, then I should count as one.

 

IDAttemptErrorISAttemptValid
1errorFalse
2nullTrue
1nullTrue
3errorfalse
3nulltrue

 

Regards,

praveen

2 REPLIES 2
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

Create a index column from Power query then create a new column like below and use it as filter on your visual:-

Column =
VAR result =
    COUNTROWS (
        FILTER (
            'Table',
            'Table'[ID] = EARLIER ( 'Table'[ID] )
                && 'Table'[ISAttemptValid] = FALSE ()
                && 'Table'[Index] < EARLIER ( 'Table'[Index] )
        )
    )
RETURN
    IF ( result > 0, 1, 0 )

Output:-

Samarth_18_0-1647447026642.png

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

johnt75
Super User
Super User

You could create a measure as

Num valid attempts = CALCULATE( COUNTROWS( 'Table' ), 'Table'[Is Valid Attempt] = TRUE() )

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.