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
adnanarain
Helper V
Helper V

Need 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
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@adnanarain , Create a new column like

if( countx(filter(table,[serialnumber] =earlier([serialnumber]) && [status] ="Fail"),[serialnumber])+0>=1, "No","Yes")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Greg_Deckler
Community Champion
Community Champion

@adnanarain -

Right First Time =
  IF(COUNTROWS(FILTER(ALL('Table'),[serialnumber]=EARLIER([serialnumber]) && [status]="Fail"))>=1,"No","Yes")



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@adnanarain -

Right First Time =
  IF(COUNTROWS(FILTER(ALL('Table'),[serialnumber]=EARLIER([serialnumber]) && [status]="Fail"))>=1,"No","Yes")



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@adnanarain , Create a new column like

if( countx(filter(table,[serialnumber] =earlier([serialnumber]) && [status] ="Fail"),[serialnumber])+0>=1, "No","Yes")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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