Forum Discussion

Gusd8's avatar
Gusd8
Icon for Helper I rankHelper I
4 years ago
Solved

Create a table to generate a pass rate

Thank you for looking, I am not sure why I am struggling with this...   Let's say we have a 20 Classes. In those 20 classes there is a total class roster of 500 students spread between them. A stud...
  • danextian's avatar
    4 years ago

    HI Gusd8 

     

    Given your current data, first I would compute for the count of unique students and then the student with failed subjects only (assuming that if a student has only 0s in fail column, he passes all the subjects). I'd use those calculations to compute for the pass rate. Try this formula below as a measure.

    Pass Rate2 = 
    VAR StudenstWithFails =
        CALCULATE (
            DISTINCTCOUNT ( 'Table'[Student] ),
            FILTER ( 'Table', 'Table'[Fail] > 0 )
        )
    VAR TotalStudents =
        DISTINCTCOUNT ( 'Table'[Student] )
    RETURN
    DIVIDE ( TotalStudents - StudenstWithFails, TotalStudents )