Forum Discussion
ChubbChubb
Helper I
2 years agoAttendance type over 10 Weeks
I need to work out on a rolling 10 week block how many particular attendance codes students have recieved during that 10 week cycle and if it is 10 or more flag them. This is the code I use to wo...
mh2587
Super User
2 years agoRolling_10Week_Attendance_Flag = //Try this one
VAR StartDate = TODAY() - 63 // 63 days = 9 weeks
VAR EndDate = TODAY() // Current date
RETURN
CALCULATE(
COUNTROWS(ROLL_CALL_ATTENDANCE),
FILTER(
ROLL_CALL_ATTENDANCE,
ROLL_CALL_ATTENDANCE[AttendanceDate] >= StartDate &&
ROLL_CALL_ATTENDANCE[AttendanceDate] <= EndDate
)
) >= 10
ChubbChubb
Helper I
2 years agothanks, I have to take into account school holidays, which is where the WEEK INDEX comes in as my date table contains all dates and I'm using the WEEK INDEX to show which are term dates.
- mh25872 years ago
Super User
Can you please share sample data ?
- ChubbChubb2 years ago
Helper I