Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
dcadwallader
Helper I
Helper 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; 50 of those cars passed inspection, 50 of those cars failed inspection and the remaining 50 were not inspected. As such, my pass rate on this is 50%.

 

I have the below DAX, which I assume should work;

 

Calc Inspection Result Pass Rate =
DIVIDE(
CALCULATE( COUNTROWS('EXTRACT') , 'EXTRACT'[Overall Result - Post Appeal] = "Pass" , COUNTROWS('EXTRACT') , 'EXTRACT'[Overall Result - Post Appeal] = "Fail") ,
CALCULATE( COUNTROWS('EXTRACT') , 'EXTRACT'[Overall Result - Post Appeal] = "Pass") ,
BLANK()
)

 

But I keep getting the below error message - The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column.

 

Any ideas?

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

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:

ValtteriN_0-1641473680593.png


DAX:

Apples & Oranges =
DIVIDE(
CALCULATE(COUNTROWS(Applecount),Applecount[AppleCount]="Apple"),
CALCULATE(COUNTROWS(Applecount),or(Applecount[AppleCount]="Apple",Applecount[AppleCount]="Orange")),
BLANK()
)
 
End result:

ValtteriN_1-1641473728521.png


I hope this helps and if it does consider accepting this as a solution and giving the post a thumbs up!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
dcadwallader
Helper I
Helper I

Excellent stuff - cheers mate

ValtteriN
Super User
Super User

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:

ValtteriN_0-1641473680593.png


DAX:

Apples & Oranges =
DIVIDE(
CALCULATE(COUNTROWS(Applecount),Applecount[AppleCount]="Apple"),
CALCULATE(COUNTROWS(Applecount),or(Applecount[AppleCount]="Apple",Applecount[AppleCount]="Orange")),
BLANK()
)
 
End result:

ValtteriN_1-1641473728521.png


I hope this helps and if it does consider accepting this as a solution and giving the post a thumbs up!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.