Forum Discussion
DataSkills
3 years agoResolver I
Excluding after date using slicer
Hi, I have a scenario where I have patients who are in a care facility. These patients get various assessments done during their stay such as weight, BMI, blood pressure, cholesterol etc. I disp...
- 3 years ago
Hello MohammadLoran25 thank you for your suggestion.
I have solved this another way. What I did was to create a calculated column as follows:
Active = If(calculate(Values(Assessment_Period[EndDate]),filter(Assessment_Period, Assessment[Months] = Assessment_Period[Months])) > EOMONTH(calculate(Values(Patient[FileClosed]),filter(Patient, Assessment[PatientId] = Patient[Id])), 0), "No", "Yes")This determines at the row level in the assessment table if that particular assessment is for a patient who is no longer active.
MohammadLoran25
3 years agoSolution Sage
I am not sure because of lack of data. But I think following these steps would solve your problem:
1-Create a measure as below:
PatientFilter =
SUMX (
FILTER (
Assesment,
YEAR ( RELATED ( Patient[FileClosed] ) ) * 12
+ MONTH ( RELATED ( Patient[FileClosed] ) )
= YEAR ( MAX ( DateTable[Date] ) ) * 12
+ MONTH ( MAX ( DateTable[Date] ) )
|| ISBLANK ( RELATED ( Patient[FileClosed] ) )
|| RELATED ( Patient[FileClosed] ) >= MAX ( DateTable[Date] )
),
1
)
2-Then Put this measure as a filter on your visual in filterpane. (set it to advanced filter, IS GREATER THAN 0).
**Notice that at first your visual shows no value, But once you put date slicer from date table and select a date, it would work and shows the related patients.
If this answer solves your problem, please give it a thumbs up and mark it as an accepted solution so the others would find what they need easier.
Regards,
Loran