Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I would like to count how many people are below 50% when I have a column that is listed below. As you can see, Bob is at 25% and Lucy is at 66% so the count would be 1. Similar, a % would be good as well so the answer in this case would be 50%
Bob Smith | Pass |
Bob Smith | Fail |
Bob Smith | Fail |
Bob Smith | Fail |
Lucy Brown | Fail |
Lucy Brown | Pass |
Lucy Brown | Pass |
Solved! Go to Solution.
Sure. I'll be making up table/column names, so adjust for your data model:
PeopleOver50% = COUNTROWS( FILTER( SUMMARIZE( Results, Results[Person], "Count Pass", CALCULATE(COUNTROWS(Results), Results[Pass/Fail] = "Pass"), "Count Total", COUNTROWS(Results) ), [Count Pass]/[Count Total] >= .5 ) )
This measure will give you a direct count of those people with a Pass/Total of greater than or equal to 50%. I kept all the parts of the percentage calculation separated to allow you to rearrange and use the pieces as needed. Usually I would calculate the percentage directly instead of storing them separately in the SUMMARIZE table.
Sure. I'll be making up table/column names, so adjust for your data model:
PeopleOver50% = COUNTROWS( FILTER( SUMMARIZE( Results, Results[Person], "Count Pass", CALCULATE(COUNTROWS(Results), Results[Pass/Fail] = "Pass"), "Count Total", COUNTROWS(Results) ), [Count Pass]/[Count Total] >= .5 ) )
This measure will give you a direct count of those people with a Pass/Total of greater than or equal to 50%. I kept all the parts of the percentage calculation separated to allow you to rearrange and use the pieces as needed. Usually I would calculate the percentage directly instead of storing them separately in the SUMMARIZE table.
You should use that entire expression to show a count. Add that measure into a card or other visual, and it will display a number of people that have a pass rate of over 50%.
User | Count |
---|---|
139 | |
113 | |
103 | |
73 | |
63 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |