Forum Discussion
Slice/Filter That Behaves Like an AND Operator
Hello!
I have a "Customer Services" and "Services" tables like below
| Customer | Services |
| Customer1 | "Service1" |
| Customer2 | "Service2,Service3" |
| Customer3 | "Service3,Service4" |
| Customer4 | "Service1,Service3,Service4" |
| Customer5 | "Service2" |
| Services |
| Service1 |
| Service2 |
| Service3 |
| Service4 |
| Service5 |
The order of Services values in the "Customer Services" table is always in ascending order. I also have a slicer using the Services table. I split the Services column and put it in a separate table and linked the 3 tables.
| Customer | Services |
| Customer1 | "Service1" |
| Customer2 | "Service2" |
| Customer2 | "Service3" |
| Customer3 | "Service3" |
| Customer3 | "Service4" |
My expected output is, if I only select "Service1", I should only get "Customer1". If I select "Service2" and Service3", I should only get "Customer2". If I select "Service3", then I get no result, and so on. If I don't select anything, I should get all customers.
How am I suppose to do this? The relationships between the 3 tables is behaving like an OR operator and not AND.
I appreciate any inputs. Thank you.
4 Replies
- Greg_Deckler
Community Champion
jmerencilla I built an AND slicer once. Patient Cohort (AND Slicer) - Microsoft Fabric Community
- jmerencilla
Helper I
hi Greg_Deckler . I looked into Patient Cohort file, and this is almost the same thing that I did, except I concat the services, and compare it to my first table. But I can't get it to work. I encounter runtime memory exceptions when I do this even though my first table has less than 600 records.
In your file, is there a way to show those selected patients in a table?
- lbendlin
Super User
Read about INTERSECT() . You may not want to join these tables.
- Ashish_Mathur
Super User
Hi,
The services table should then only have the as-is unique entries as those that exist in the first table.