Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Slicer: AND values with multiple rows. Rows with same id and diferent values

Hello!   I have this scenario:                           The behaviour desired by selecting two or more options in the Slicer, is showing in the Table only the results that matc...
  • Anonymous's avatar
    Anonymous
    8 years ago

    Hi Ashish_Mathur, thank you so much for your reply.

     

    After understanding and testing your solution posted in your website, I have to say that is a very good (and ingenious) solution approach. I lightly have modified some formulas to adapt it to my scenario. I will explain here the solution adopted for me:

     

    Creating two measures:

    (Counts te number of selections done in the slicer)

     

    M1 = COUNTROWS(ALLSELECTED(_TEST[group]))

    (Distinct because it is contemplated that there are repeated groups for the same id)

     

    M2 = DISTINCTCOUNT(_TEST[group])

     

     

    Using them together into a new other like this:

     

     

     

    Measure = 1*([M1]=[M2])

     

    The result of this Measure is 1 if the id matches all the selections and 0 otherwise. Then, only have to filter the visual with this Measure equal to 1, to change the behaviour of the slicer from OR to AND.

     

    The unique wrong case I found with this solution is when no selections are done. It is because ALLSELECTED returns the entire set when no selections are done.

     

    Waiting to solve the problem with ALLSELECTED, I will mark this reply as solution.

     

    Thanks again.

    Regards

     

    --

     

    Javi.