Forum Discussion
Filter a card using a table
- 4 months ago
The issue was that some activities had an attendance of 0 so I needed to explicit about filtering that out:
Total Activities with Filtering =
// Check whether there is filtering on attendance groups
VAR _NoSelection =
(ISBLANK(SELECTEDVALUE(attendance_groups_DIM[AgeGroup])) &&
ISBLANK(SELECTEDVALUE(attendance_groups_DIM[TypeGroup])))RETURN
CALCULATE(
[Total Activities],
// If there is filtering, count activities only where the count of attendances for the relevant group is not 0
// It's not strictly necessary to wrap "UnpivotedAttendances_FACT[Value] <> 0" in an IF statement, but without it, it won't count activities with 0 attendance (and it looks like there is one such activity)
FILTER(UnpivotedAttendances_FACT,
IF(_NoSelection = FALSE,
UnpivotedAttendances_FACT[Value] <> 0,
TRUE())
))
HollyMusgrove Hey,
Your card isn’t responding to filters because the SUM isn’t wrapped in a context-sensitive function. Try this adjusted measure:
Total Activities =
CALCULATE(
SUM(activity_info_FACT[CountInTotals]),
CROSSFILTER(attendance_info_FACT[LogID], activity_info_FACT[LogID], BOTH)
)
Try this measure, let me know if this solve your problem.
Thanks
Harish M
Give kudos if I solve your problem. Accept this as solution.