Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
im_92
Frequent Visitor

Filter drop down using AND function

Hi all, 

 

When using the slicer filter (displayed as drop-down), I would like it to use an AND function when selected multiple items. 

Basically, I want to be able to filter patients based on the comorbidities they have. So when I select 2 or more items in the comorbidity drop down list, I want the report to show the characteristics of the patients that have both/all comorbidities, and not only one of them (OR function; as it works now). Is there any way to do this? 

Thanks! 

 

3 REPLIES 3
v-deddai1-msft
Community Support
Community Support

Hi @im_92 ,

 

The default behaviour of the slicer in Power BI is that it shows the result of OR when you select multiple items. If you want to having AND condition using a slicer in Power BI you should use measure to control it.

 

Here is a good article for your reference: https://radacad.com/slicer-with-and-condition-in-power-bi and if you want the  exact formula, please show your sample data.

 

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

 

Best Regards,

Dedmon Dai

amitchandak
Super User
Super User

@im_92 , Creat a measure like

measure =
var _max = countx(allselcted(Table,table[comorbidities]))
return
countx(filter(summarize(Table, Table[patients], "_1",distinctcount(table[comorbidities])),[_1]=_max),[patients])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
S_JB
Resolver III
Resolver III

If you go to the formatting options for your slicer and go into selection controls,  turn single select off and multi-select with CTRL off and turn Show "select all" on. 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors