Forum Discussion
Academic course pass rate
- Anonymous7 years ago
Hi Anonymous
Create a measure to retreive pass/total.
PASS_RATE_M = VAR TOTAL_COUNT = COUNTROWS ( T22 ) VAR PASS_COUNT = CALCULATE ( COUNTROWS ( T22 ), FILTER ( T22, T22[Grade] IN { "A", "B", "C" } ) ) RETURN PASS_COUNT / TOTAL_COUNTCheers!
A
Hi Anonymous
Create a measure to retreive pass/total.
PASS_RATE_M =
VAR TOTAL_COUNT =
COUNTROWS ( T22 )
VAR PASS_COUNT =
CALCULATE (
COUNTROWS ( T22 ),
FILTER (
T22,
T22[Grade]
IN {
"A",
"B",
"C"
}
)
)
RETURN
PASS_COUNT / TOTAL_COUNT
Cheers!
A
Thank you for the quick response. I used the statement and only have to change the table name but I get the error message below:
Pass Rate = COUNTROWS('By Program')
VAR Pass Count = CALCULATE(COUNTROWS('By Program'), FILTER('By Program', [Grade] IN {"A", "B", "C", "P"}))
Return Pass Rate/[Pass Count]
However, I decided to create two separate measures, one that adds pass grades:
Pass Count = CALCULATE(COUNTROWS('By Program'),FILTER('By Program', [Grade] IN {"A", "B", "C", "P"}))
and another that adds all grades: All Grades = COUNTROWS('By Program'), then do Pass Count/All Grades to get my desired results.
What are my doing wrong in the error message in order to have all three measures into one?
- Anonymous7 years agoNot applicable
Anonymous
Looks like your VAR name contains a spcae which is not alowed.
Pass Rate --> Pass_Rate
Pass Count --> Pass_Count
etc.
Thanks!
A