Forum Discussion
Calculation over a moving window
Yes, there are other filters. Good catch! All didn't work, but ALLSELECTED did:
THANK YOU!!!
parry2k -- one additional question for you on this cacluation. It's working great, but one additional layer of complexity.. The rolling window for undergraduate terms is 6 terms and the rolling window for graduate terms is 5 terms. I am hoping to have one calculation that does this rolling metric figuring in the different rolling windows. We do have a way to determine the term type of UG and GR, so that can be used as an attribute somewhere.
I thought I could fumble my way through it, but I'm hitting a wall. I am wondering if there is a way to adjust the logic in the __StartRow using the term type criteria?
As a reminder, the current calcuation is:
- heidibb6 years agoHelper IV
Just to close the loop on this, I think I've figured it out.
I created a UG rate:
Rolling Graduated 150% UG =
VAR __currRow = max ( 'Graduation Retention'[DegreeLevelCohortTermAxis])
VAR __startRow = __currRow - 5
RETURN
CALCULATE ([Total Graduated 150%], ALLSELECTED('Graduation Retention'), 'Academic Program'[AcademicLevelCode] = "UG", 'Graduation Retention'[DegreeLevelCohortTermAxis] >= __startRow , 'Graduation Retention'[DegreeLevelCohortTermAxis] <= __currRow)And a GR rate:
Rolling Graduated 150% GR =
VAR __currRow = max ( 'Graduation Retention'[DegreeLevelCohortTermAxis])
VAR __startRow = __currRow - 4
RETURN
CALCULATE ([Total Graduated 150%], ALLSELECTED('Graduation Retention'), 'Academic Program'[AcademicLevelCode] = "GR",'Graduation Retention'[DegreeLevelCohortTermAxis] >= __startRow , 'Graduation Retention'[DegreeLevelCohortTermAxis] <= __currRow)Then a final measure:
150% = SWITCH(SELECTEDVALUE('Graduation Retention'[Academic Level Code]), "UG", [Rolling Graduated 150% UG] , "GR", [Rolling Graduated 150% GR]) - Syndicate_Admin5 years agoAdministrator
Just to close the loop on this, I think I've figured it out.
I created a UG fee:
Rolling Graduated 150% UG ?
VAR __currRow máx ( 'Graduation Retention'[DegreeLevelCohortTermAxis])
VAR __startRow - __currRow - 5
return
CALCULATE ([Total Graduate 150%], ALLSELECTED('Graduation Retention'), 'Academic Program'[AcademicLevelCode] - "UG", 'Graduation Retention'[DegreeLevelCohortTermAxis] >-__startRow , 'Graduation Retention'[DegreeLevelCohortTermAxis] <-__currRow)And a GR rate:
Rolling Graduate 150% GR ?
VAR __currRow máx ( 'Graduation Retention'[DegreeLevelCohortTermAxis])
VAR __startRow - __currRow - 4
return
CALCULATE ([Total Graduate 150%], ALLSELECTED('Graduation Retention'), 'Academic Program'[AcademicLevelCode] - "GR",'Graduation Retention'[DegreeLevelCohortTermAxis] > __startRow , 'Graduation Retention'[DegreeLevelCohortTermAxis] <-__currRow)Here's a final measure:
150% - SWITCH(SELECTEDVALUE('Graduation Retention'[Academic Level Code]), "UG", [Rolling Graduated 150% UG] , "GR", [Rolling Graduated 150% GR])