This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
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 work out the attendance type %
@Anonymous it should work now to download the file.
I'm not sure to be honest, Its a shame I cna't just upload a file to the forum
Hi @ChubbChubb ,
You can upload pbix files to OneDrive, Google Drive and share the links.
Hi @ChubbChubb ,
Please follow these steps:
1. Use the following DAX expression to create a column in 'DATE_TABLE'(If today is not within a semester, find the nearest future date within a semester)
Column = IF(ISBLANK([Term Week Index]),MINX(FILTER('DATE_TABLE',[Date] >= EARLIER([Date]) && [Term Week Index] <> BLANK()),[Date]))
2.Use the following DAX expression to create a table named 'Table'
Table = FILTER('DATE_TABLE','DATE_TABLE'[Term Week Index] <> BLANK())
3.Use the following DAX expression to create a column in 'Table'
Column 2 = COUNTROWS(FILTER('Table',[Date] <= EARLIER('Table'[Date])))
4.Use the following DAX expression to create a measure(I assumed the date.)
Measure =
VAR _today = DATE(2021,12,16)
VAR isTearmDay = LOOKUPVALUE('DATE_TABLE'[Term Week Index],DATE_TABLE[Date],_today)
VAR _a = LOOKUPVALUE(DATE_TABLE[Column],'DATE_TABLE'[Date],_today)
VAR startDay = IF(ISBLANK(isTearmDay),_a,_today)
VAR _b = LOOKUPVALUE('Table'[Column 2],'Table'[Date],startDay) + 69
VAR endDay = LOOKUPVALUE('Table'[Date],'Table'[Column 2],_b)
VAR _c = SELECTCOLUMNS(FILTER('Table','Table'[Date] >= startDay && 'Table'[Date] <= endDay),"Date",[Date])
VAR _d = CALCULATE(
COUNTROWS(ROLL_CALL_ATTENDANCE),
FILTER(ROLL_CALL_ATTENDANCE,ROLL_CALL_ATTENDANCE[IS_UNAUTHORIZED_ABSENT]=TRUE()),
FILTER(ROLL_CALL_ATTENDANCE,ROLL_CALL_ATTENDANCE[IS_POSSIBLE_ATTENDANCE]=TRUE()),
FILTER(ROLL_CALL_ATTENDANCE,ROLL_CALL_ATTENDANCE[DATE] IN _c)
)
RETURN _d
Rolling_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
thanks, 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.
Can you please share sample data ?
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 28 | |
| 28 | |
| 20 | |
| 18 |
| User | Count |
|---|---|
| 65 | |
| 35 | |
| 33 | |
| 25 | |
| 24 |