Forum Discussion
jjfr
2 years agoFrequent Visitor
Dynamic DAX Measure to Count Distinct Rows filtered by separate query
Hi All, I'm pretty new to DAX and struggling to figure this out so any help is greatly appreciated. I have the following data model (simplified): I am trying to write a measure tha...
- 2 years ago
Hi, jjfr You use ALL('Appointments') it kill effect of outer filter from same table(Appointments) and related expanded table.
Try below measure# Appointment Attendees (Distinct Students) = CALCULATE ( DISTINCTCOUNT('Enrolment'[Student ID]), FILTER(ALL('Appointments'[Attendance Status]), 'Appointments'[Attendance Status] = 2)Best regards,
DangarIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Dangar332
2 years agoResident Rockstar
Hi, jjfr You use ALL('Appointments') it kill effect of outer filter from same table(Appointments) and related expanded table.
Try below measure
# Appointment Attendees (Distinct Students) =
CALCULATE ( DISTINCTCOUNT('Enrolment'[Student ID]),
FILTER(ALL('Appointments'[Attendance Status]), 'Appointments'[Attendance Status] = 2)
Best regards,
Dangar
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.