Forum Discussion

FARIDMD's avatar
FARIDMD
Regular Visitor
3 years ago
Solved

Find the Count after filter is set

Hi,   I need assistance from expert to find the number of count after filter is set.   I have total count of name from a set of date range. For example from 8/11/2021 - 21/09/2023 i have 2595 cou...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi FARIDMD ,

     

    As ChiragGarg2512 mentioned above, Power BI won't store the snapshot value when you change the slicer.

    I suggest you to create two unrelated Calendar table for two slicers.

    Then use USERELATIONSHIP() function. Measures:

     

    Count of Name 1 = 
    CALCULATE(COUNT('Table'[Name]),USERELATIONSHIP('Table'[Date],'Slicer 1'[Date]))
    Count of Name 2 = 
    CALCULATE(COUNT('Table'[Name]),USERELATIONSHIP('Table'[Date],'Slicer 2'[Date]))
    Difference = [Count of Name 1] - [Count of Name 2]

     

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.