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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

How to create AND/OR filters

Hi, noob question here, apologies in advance if this is too trivial.

I have the following table in my data model

 

IDFEAT1FEAT2FEAT3
1TRUEFALSEFALSE
2FALSETRUEFALSE
3TRUEFALSETRUE

 

I am not sure about what happens when I create slicer filters. What if I create one slicer per feature and I set, let's say, feat1=TRUE and feat3=TRUE?
My guess is that I will see all records having feat1=TRUE and all records having feat3=TRUE, not all records having both eat1=TRUE and feat3=TRUE at the same time (i.e. it is not an AND filter).

 

So, how do I create AND filters?

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @Anonymous ,

 

acutally it's the other way around both slicers will work as AND.

In a somewhat simpliefied thinking one can compare the behavior of slicers that are origin from the same table as the Auto-Filter feat in Excel.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , AND is the default behavior. For Or you need one or 2 independent slicer

 

one sclicer -- for both -- independent

measure =
var _tf = maxx(slicer,slicer[value]) //independent table
return
calculate(countrows(Table), filter(Table, Table[FEAT1] =_tf || Table[FEAT3] =_tf))

 

// and

 

measure =
var _tf = maxx(slicer,slicer[value]) //independent table
return
calculate(countrows(Table), filter(Table, Table[FEAT1] =_tf && Table[FEAT3] =_tf))


Two sclicerw -- one for each -- independent

measure =
var _tf = maxx(slicer,slicer[value]) //independent table
var _tf1 = maxx(slicer1,slicer1[value]) //independent table
return
calculate(countrows(Table), filter(Table, Table[FEAT1] =_tf || Table[FEAT3] =_tf1))

 

// and

 

measure =
var _tf = maxx(slicer,slicer[value]) //independent table
var _tf1 = maxx(slicer1,slicer1[value]) //independent table
return
calculate(countrows(Table), filter(Table, Table[FEAT1] =_tf && Table[FEAT3] =_tf1))

 

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
daxer-almighty
Solution Sage
Solution Sage

Well, with this table IT IS an AND filter. If you pivot the table on ID, this will then be an OR filter.
TomMartens
Super User
Super User

Hey @Anonymous ,

 

acutally it's the other way around both slicers will work as AND.

In a somewhat simpliefied thinking one can compare the behavior of slicers that are origin from the same table as the Auto-Filter feat in Excel.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.