Forum Discussion
Anonymous
4 years agoNot 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.
| ID | AttemptError | ISAttemptValid |
| 1 | error | False |
| 2 | null | True |
| 1 | null | True |
| 3 | error | false |
| 3 | null | true |
Regards,
praveen
2 Replies
- johnt75Super User
You could create a measure as
Num valid attempts = CALCULATE( COUNTROWS( 'Table' ), 'Table'[Is Valid Attempt] = TRUE() )
- Samarth_18Community 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:-
Thanks,
Samarth