Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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%.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
78 | |
75 | |
50 |
User | Count |
---|---|
144 | |
109 | |
108 | |
88 | |
61 |