Forum Discussion

SirBI's avatar
SirBI
Frequent Visitor
3 years ago
Solved

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 ...
  • halfglassdarkly's avatar
    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)