March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello Community,
I would like for the multiselection in the slicer to get back the AND between the selection instead of OR. I found on the internet many articles on how to do it but the relationship between their table is one to many, and in my case is Many To Many as my id is duplicated.
My model is as follows:
The table data looks like:
The reason why I have Many to Many relationships as I have for each id is there is a flow to products and each has a category, my category filter table looks like this:
My Slicer works as Or between two categories selected:
Thank you for reading, In summary, I want to have a slicer with And logic when the relationship between the tables is Many To Many.
Here is the pbix: https://drive.google.com/file/d/1bjP4kHN3YL3c5zEZ8Nf7-QGp9OXIwAma/view?usp=sharing
Solved! Go to Solution.
Hi, @unkCandy ;
You could create a flag measure.
flag =
var _count= CALCULATE(DISTINCTCOUNT([Category]),FILTER(ALLEXCEPT('data','data'[Id]),[Category] in ALLSELECTED('Category Filter'[Category])))
var _count2=CALCULATE(DISTINCTCOUNT('Category Filter'[Category]),REMOVEFILTERS('data'))
return IF(_count=_count2,1)
Then apply it into table filter.
The final output is shown below:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @unkCandy ;
You could create a flag measure.
flag =
var _count= CALCULATE(DISTINCTCOUNT([Category]),FILTER(ALLEXCEPT('data','data'[Id]),[Category] in ALLSELECTED('Category Filter'[Category])))
var _count2=CALCULATE(DISTINCTCOUNT('Category Filter'[Category]),REMOVEFILTERS('data'))
return IF(_count=_count2,1)
Then apply it into table filter.
The final output is shown below:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello Mfelix, thank you for your reply and your time, but maybe I wasn't clear about my problem.
Actually, I created the other table Category Filter to get all products per ID when a category is included in the ID. Now I want if I select two categories to give me the IDs that have both categories, with all products.
I hope I was clear. and thank you again
Hi @unkCandy .
Try to add the following measure to your model:
Filtering on Category = COUNTROWS(FILTER(data, data[Category] in VALUES('Category Filter'[Category])))
Now add this has a visual filter and select all non blank values:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsMarch 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
45 |
User | Count |
---|---|
204 | |
106 | |
98 | |
65 | |
54 |