Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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
  • 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/

3 Replies

  • mwegener's avatar
    mwegener
    Icon for Most Valuable Professional rankMost 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/