Forum Discussion
Simon_Evans
Helper I
3 years agoSome help required with a measure
Hi Everyone I'm a little bit stumped with what I think should be quite easy but I'm not sure how to achieve it. Here is what I need. I need a measure that counts the number of students where the...
Anonymous
3 years agoNot applicable
I'm thinking something like this, although I admittedly don't know whether ADDCOLUMNS() will accept a measure as expression argument.
var t_Attendance=
ADDCOLUMNS('SessionAttendance', "att_Rate", [Attendance Rate])
return
CALCULATE(
COUNTROWS('t_Attendance'[StudentID]),
FILTER(att_Rate<=0.9)
)
Let me know how it goes.
Simon_Evans
Helper I
3 years agoThank you. I gave that a try but all I got back was error saying the Basetable was missing.
However I did start getting a bit creative about creating a temporary Summarise table and ended up with the following measure:
Perabsent =
var TempTable = SUMMARIZE(SessionAttendance,SessionAttendance[Student ID],"Present Marks",[Total Present Marks],"Possible Sessions",[Total Marks],"Percentage Attendance",[Total Present Marks]/[Total Marks])
var result = CALCULATE(COUNTROWS(TempTable),FILTER(TempTable,[Percentage Attendance] <= 0.90))
RETURN
result
The table it creates looks like this:
Problem is this just counts the number of rows within the temporary table. Again the Calculate function appears to be ignoring the filter.
Any further ideas welcome but I am also looking at the Evaluate function as that may be able to do this.
Any further ideas welcome but I am also looking at the Evaluate function as that may be able to do this.
Kindest regards
Simon