Forum Discussion
adnanarain
Helper V
6 years agoNeed help with if condition Dax
I want to add calculated column, if the same serial number contains any fail value in status column then calculated column should be equal to NO, no matter how many pass values are there. Below is the my data model.
| serialnumber | status | Right First Time |
| JAA20H1700093 | Pass | No |
| JAA20H1700093 | Pass | No |
| JAA20H1700093 | Fail | No |
adnanarain , Create a new column like
if( countx(filter(table,[serialnumber] =earlier([serialnumber]) && [status] ="Fail"),[serialnumber])+0>=1, "No","Yes")
Right First Time = IF(COUNTROWS(FILTER(ALL('Table'),[serialnumber]=EARLIER([serialnumber]) && [status]="Fail"))>=1,"No","Yes")
2 Replies
- amitchandak
Super User
adnanarain , Create a new column like
if( countx(filter(table,[serialnumber] =earlier([serialnumber]) && [status] ="Fail"),[serialnumber])+0>=1, "No","Yes")
- Greg_Deckler
Community Champion
Right First Time = IF(COUNTROWS(FILTER(ALL('Table'),[serialnumber]=EARLIER([serialnumber]) && [status]="Fail"))>=1,"No","Yes")