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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Use count that apply on a filter

I have this measure:

 

#avg grade to pass = DIVIDE(CALCULATE(SUM(StudentResults[result]); StudentResults[result] >= 5,5); DISTINCTCOUNT(StudentResults[studnr]))
 
It needs to calculate the average grade it took a student to pass (which is 5,5 of higher). But my measure also counts the students that did not pass, the filter is not applied to the count. How can I solve this?
 
Table:
studnr course result
105B6,1
105B3,9
105A9,1
104B7,8
104B4,6
103A6,6
102A4,6
102B5,4
102B4,4
102B3,1
101B7,6
101B3,5
101B3,1
101A7
101A3,7
1 ACCEPTED SOLUTION
mwegener
Most Valuable Professional
Most Valuable Professional

Try this.

 

#avg grade to pass = CALCULATE(DIVIDE(SUM(StudentResults[result]);DISTINCTCOUNT(StudentResults[studnr]));StudentResults[result] >= 5,5)
 
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.
Looking for German Power BI content? Visit my blog.
http://www.thinkbi.de/
Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


View solution in original post

3 REPLIES 3
mwegener
Most Valuable Professional
Most Valuable Professional

Try this.

 

#avg grade to pass = CALCULATE(DIVIDE(SUM(StudentResults[result]);DISTINCTCOUNT(StudentResults[studnr]));StudentResults[result] >= 5,5)
 
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.
Looking for German Power BI content? Visit my blog.
http://www.thinkbi.de/
Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Anonymous
Not applicable

Nice! It works, did not know that you can use the calculate like that.

mwegener
Most Valuable Professional
Most Valuable Professional

I recommend this free "Introducing DAX Video Course"

https://www.sqlbi.com/p/introducing-dax-video-course/

 

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.