Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Count of Boolean

Hello, I have a boolean that looks at 2 conditions to make a decision. Then I have a measure that is supposed to count the number of "Failed" conditions. My count calculation keeps pulling both conditions instead of just one "fail". I have included both of my calculations as well as a screen shot of my results. What I want is for my "Count of Fail" to only count the number "Fail" words, not the number of failed conditions.

 

Here is what I want from the following DAX code (I only want the document to fail 1 time. Even if both conditions are met):

CONDITION: IF condition A is met then fail

                     IF condition B is met then fail

 

CODE: Pass/Fail = IF(OR(Rejected[Action] = "REJECTED", Rejected[Status Code] = "BACKWARD"),"Fail", "Pass")

 

Here is my Count of Fail code:

Count of Fail = CALCULATE(COUNT(Rejected[Pass/Fail]), FILTER(Rejected, Rejected[Pass/Fail] = "Fail"))
 
And here is the result I am getting. See where it says 2 when both conditions have been met? I only want it to fail one time no matter how many failures there are.

 

DocumentRejectedBackwardPass/FailCount of Fail
abc11Fail2
ded10Fail1
iek01Fail1
oow11Fail2
ytr00Pass0
  • Anonymous's avatar
    Anonymous
    7 years ago

    I ended up changing my counting formula.  I counted the number of documents that had a status of "Fail".

     

    CALCULATE(DISTINCTCOUNT(Rejected[Change Number]), FILTER(Rejected, Rejected[Pass/Fail] = "Fail"))

4 Replies