I work at a higher education institution, and we are trying to measure students' perseverance rates at the institution, which is simply defined as:
[Total Terms Registered] / [Total Terms Since First Term]
There is a record for every term a student registers. So a registration in Fall 2023 would result in a row with their student ID and their current information (such as GPA, degree program, student group, etc.) and a registration in Spring 2024 would result in a second row also with their student ID and current information. In another table I have ranked each term by it's recency, which looks essentially like this:
Term | Ranking |
---|---|
Spring 2024 | 1 |
Fall 2023 | 2 |
Summer 2023 | 3 |
... | ... |
We have three terms in a year. So, if a student had their first term two years ago, but took a break every third term, it would result in:
4 / 6 = .67
But, if, say, a student started five years ago, quit after one year, came back three years later to start taking classes for another year, it would result in an unfair and skewing result of:
6 / 15 = .4
What I would like to have is their first term "restart" after any 2+ year absence period, so the above example would instead have a result of:
3 / 3 = 1.
However, this is proving difficult, as I haven't been able to find a way to have Power BI or Power Query look for a two-year gap in a student's registration records and then start from the record immediately after the two-year gap.
My working solution at this point is to simply pull the registrations from the last 3 years using the DAX formula below, filtering out any rows that have terms more than 9 terms ago (i.e. having a ranking lower than 9):
RegisteredTerms =
VAR CurrentStudentID = StudentInfo[ID]
RETURN
COUNTROWS(
FILTER(
FILTER(
StudentInfo,
StudentInfo[ID] = CurrentStudentID
),
StudentInfo[TermRecencyResult] <= 9
)
)
I then divide that by by the total number of terms since their first term, again, filtering out any records of terms more than three years ago:
TotalTerms =
VAR CurrentStudentID = Consolidation[ID]
RETURN
MAXX(
FILTER(
FILTER(
StudentInfo,
StudentInfo[ID] = CurrentStudentID
),
StudentInfo[TermRecencyResult] <= 9
),
StudentID[TermRecencyResult]
)