Forum Discussion
Slicer: AND values with multiple rows. Rows with same id and diferent values
- Anonymous8 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.
- Anonymous8 years agoNot applicable
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.
- Ashish_Mathur8 years agoSuper User
You are welcome. Thank you for your kind words. I will try to devote some time later to resolve the minor issue identified by you.