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

Calculate the percentage a value occurs in one field, for each distinct value in another field

This is my table

Capture.PNG

 I'm trying to create a new calculated field which calculates the percent each br_name passes (in the "compliance_check" column). Since BR_185550A passes each time, the new field will have 100% for the first 3 rows. Since BR_20008 passes once and fails once, it will be 50% for rows 4 and 5. The new column would then look like this:

100%

100%

100%

50%

50%

How would I do this? I'm trying to create a master item measure using a set expression but I'm not having any luck

Labels (5)
1 Solution

Accepted Solutions
Kushal_Chawda

=Count(total<br_name>{<compliance_check={'Pass'}>}br_name)/count(total<br_name>{<compliance_check={'Pass','Fail'}>}br_name)

View solution in original post

1 Reply
Kushal_Chawda

=Count(total<br_name>{<compliance_check={'Pass'}>}br_name)/count(total<br_name>{<compliance_check={'Pass','Fail'}>}br_name)