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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ortiz99
Regular Visitor

How do I change to AND logic every field of Smart Filter OkViz?

Hello!

Y have the following Smart filter by OkViz:

ortiz99_0-1669980463762.png

The actual way of each field filtering is with OR logic and i want to change it to AND logic. (The filtered results (usernames) are shown in an other table i've created)

Example: I want to filter every user that matches with "condition1" AND "condition2" that are available when you search them in FIeld 1. And that with every field.

Thank you very much!

2 REPLIES 2
ortiz99
Regular Visitor

Firstly, thank you very much!

 

But, I have two questions:

 

1. Those measures, I have to add them to the Searcher visualization or to the Table where I show the results filtered visualization?

 

2. Those measures work, as I said, for every field of the slicer? Or I have to repeat them (the three ones) for every field of the slicer? (I suppose that when you write Colum, I have to substitute it with the name of the column that is linked to Field 1 for example)

 

Thank you again!

v-xiaosun-msft
Community Support
Community Support

Hi @ortiz99 ,

 

Firstly, you can use COUNTROWS function to create a measure to count the number of items selected on the slicer as below.

Number of variables selected on slicer =
IF (
    ISFILTERED ( 'Table'[Column] ),
    COUNTROWS ( ALLSELECTED ( 'Table'[Column] ) ),
    0
)

 Then create a measure.

PBISlicer Check = 
IF('Table'[Number of variables selected on slicer] = 0, 1,
 IF(DISTINCTCOUNT('Table'[Column]) = 'Table'[Number of variables selected on slicer], 1, 0))

Then calculate values which satisfies the ‘AND’ requirement.

measure = 
CALCULATE(MAX('Table'[Column]), 
FILTER('Table'[Column], [PBISlicer Check] = 1))

 

You can reference the following links.

Solved: Help setting up a Slicer / Filter with AND logic s... - Microsoft Power BI Community

Changing “OR” to “AND” Logic for Power BI Slicers | by Orysya Stus | Seismic Innovation Labs | Mediu...

 

Best Regards,
Community Support Team _ xiaosun

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.