Forum Discussion
dcadwallader
4 years agoHelper I
Percentage Calc Based on Three Values (Pass, Fail, Not Inspected)
Afternoon, I'm looking to put a Pass Rate Calc in my file that will allow for three values in a single column - Pass, Fail and Not Inspected. For example, lets say I have a sample of 150 cars...
- 4 years ago
Hi,
The problem is with the first calculate, since it has two different COUNTROWS. To solve this use OR in the filter like in this example:
Data:
DAX:Apples & Oranges =DIVIDE(CALCULATE(COUNTROWS(Applecount),Applecount[AppleCount]="Apple"),CALCULATE(COUNTROWS(Applecount),or(Applecount[AppleCount]="Apple",Applecount[AppleCount]="Orange")),BLANK())End result:
I hope this helps and if it does consider accepting this as a solution and giving the post a thumbs up!
ValtteriN
4 years agoCommunity Champion
Hi,
The problem is with the first calculate, since it has two different COUNTROWS. To solve this use OR in the filter like in this example:
Data:
DAX:
Apples & Oranges =
DIVIDE(
CALCULATE(COUNTROWS(Applecount),Applecount[AppleCount]="Apple"),
CALCULATE(COUNTROWS(Applecount),or(Applecount[AppleCount]="Apple",Applecount[AppleCount]="Orange")),
BLANK()
)
End result:
I hope this helps and if it does consider accepting this as a solution and giving the post a thumbs up!