Forum Discussion
SirBI
3 years agoFrequent Visitor
Count Measure when decreasing date filter.
I need to count current "Active Members". Meaning, when I slide my date filter to the right, the count should not change, they are still active members. But I would like to have the count change ...
- 3 years ago
You'll want the date used for the slicer to be disconnected from the date fields in your table (either using an unrelated date dimension or by explicitly ignoring the slicer values in your main calculation context.
You can store the values from the slicer as variables e.g. something like:
Var MinDate = Min('Unrelated Date Table'[Date]) Var MaxDate = Max('Unrelated Date Table'[Date]) RETURN Calculate(Count('table'[display_name]), ALLEXCEPT('table','table'[display_name]), 'table'[first_grant_d]<=MaxDate && 'table'[last_grant_d]>=MinDate)
halfglassdarkly
3 years agoResponsive Resident
You'll want the date used for the slicer to be disconnected from the date fields in your table (either using an unrelated date dimension or by explicitly ignoring the slicer values in your main calculation context.
You can store the values from the slicer as variables e.g. something like:
Var MinDate = Min('Unrelated Date Table'[Date])
Var MaxDate = Max('Unrelated Date Table'[Date])
RETURN
Calculate(Count('table'[display_name]),
ALLEXCEPT('table','table'[display_name]),
'table'[first_grant_d]<=MaxDate && 'table'[last_grant_d]>=MinDate)