So I will start by saying I cannot provide the PBIX because of FERPA protections and the student data it contains. The formula below in conjunction with the What-If Parameter allows me to see students whose registration meet the selected threshold. The problem is my intent was once qualifying the student as having met the selected threshold value in at least one month to then display registrations for all other months in the year. This is where I am unsuccessful as the it only displays results if the total registrations in the month are greater than or equal to the selected threshold value in the parameter.
Any thoughts on where I may be going wrong? See the visual attached, the below formula when the threshold is set to 3 accurately reflects the term that meets the threshold but since this is the qualifying month it should also then reflect the count of enrollments/registrations in all other terms for the individual but it fails to pickup the 2 for August.
Total Registrations Within Selected Threshold By Term =
VAR SelectedThreshold = 'Registration Threshold'[Registration Threshold Value]
-- Step 1: To summarize registrations per student and per month using Dates V2[MonthName] for proper context
VAR RegistrationsPerStudentPerMonth =
SUMMARIZE(
Registrations,
Registrations[Student ID],
'Dates V2'[MonthName],
"RegistrationsCount", COUNTROWS(Registrations)
)
-- Step 2: To Identify students who meet the threshold in at least one month
VAR QualifyingStudents =
FILTER(
ADDCOLUMNS(
SUMMARIZE(
RegistrationsPerStudentPerMonth,
Registrations[Student ID]
),
"MaxRegistrations", MAXX(
FILTER(RegistrationsPerStudentPerMonth, Registrations[Student ID] = EARLIER(Registrations[Student ID])),
[RegistrationsCount]
)
),
[MaxRegistrations] >= SelectedThreshold
)
-- Step 3: To check if the current student qualifies by having at least one month that meets the threshold
VAR IsQualifyingStudent =
CALCULATE(
COUNTROWS(QualifyingStudents),
FILTER(QualifyingStudents, Registrations[Student ID] = SELECTEDVALUE(Registrations[Student ID]))
) > 0
-- Step 4: To then return all registrations for the student if they qualify, ensuring all months and academic years are considered
RETURN
IF(
IsQualifyingStudent,
CALCULATE(
COUNTROWS(Registrations),
REMOVEFILTERS('Dates V2'[MonthName]) -- Ensure all months for the qualifying student are shown
),
BLANK() -- Exclude non-qualifying students
)