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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rakesh-k01
Frequent Visitor

How to use AND in slicer

This might be a bit hard to explain, so will update based on the info needed. 

 

Hi,

 

I have 2 tables having 1 to many relationship with the ref2per table. Capture.PNG

 

 

 

 

 

 

 

 

I' am using a slicer on ref_table to display the person table details in a matrix.

Below is the output of an example:Capture1.PNG

 Slicer is using OR to display the records having either SAP or EventBrite, but i need person records having both SAP and EventBrite. Below is the expected output.Capture2.PNG

 

 

 

Any thoughts on how this can be done?

 

Thanks

 

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@rakesh-k01

 

hi, create a measure:

 

Show =
IF ( COUNTROWS ( VALUES ( Ref_Table[name] ) ) = COUNTROWS ( Ref2Per ), 1, 0 )

and in Visual Level Filter select when Show is 1.

 

 

Or Slicer.png

 

Regards

 

Victor

Lima - Peru




Lima - Peru

View solution in original post

3 REPLIES 3
Vvelarde
Community Champion
Community Champion

@rakesh-k01

 

hi, create a measure:

 

Show =
IF ( COUNTROWS ( VALUES ( Ref_Table[name] ) ) = COUNTROWS ( Ref2Per ), 1, 0 )

and in Visual Level Filter select when Show is 1.

 

 

Or Slicer.png

 

Regards

 

Victor

Lima - Peru




Lima - Peru

@Vvelarde

 

Hi Victor,

 

Thanks again with the solution. But the measure seems to fails if I have multiple person having same name or if I have same combination of person_id and ref_source_system_id in ref2per table. Below are the two updated table.person.PNG

 

 

ref2per.PNG

Could you please help me with this. Thank you and appreciate your time.

 

Regards,

Rakesh

 

@Vvelarde

 

Hi, Thanks for the response. That actually worked! 

 

It did not work on my existing report not sure why but when I recreated the report from the scratch your solution worked. Thanks a ton. 

 

I have one single doubt though, can we have it as a slicer like an option of "AND" & "OR"?

 

Thanks 

Rakesh

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.