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

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

Reply
FPackermanGTA
Advocate I
Advocate I

Filter two tables from one slicer using OR logic

Hello,

 

Let me simplify the problem I'm trying to solve. I have two tables, one has computers from Active Directory and the other has User data from HR so,

 

The first table has the Computer Name and OU( e.g Dept) and the last user that logged into that computer. Notice some computers have had no user login.

 

The other table has Username and the department they work in.

 

FPackermanGTA_0-1633765465518.png                     FPackermanGTA_1-1633765614300.png

 

They have a relationship as follows.

 

FPackermanGTA_2-1633765676173.png

What I would like is one slicer that will update the table with all the machines in say the Finance OU and all the machines that the Users in the department Finace have logged into.

 

You can achieve the result I want with the heirarchy slicer but that requires you to search the department and select multiple boxes and require knowledge of how this works which many of the report viewer will not know about.

 

FPackermanGTA_3-1633765879396.png

 

If you slice by OU you don;t get computer 5 and slice by Department you miss computer 4 and because they use AND logic if you select both then you miss computer 4 and 5.

FPackermanGTA_4-1633765930079.pngFPackermanGTA_5-1633766216232.pngFPackermanGTA_6-1633766311916.png

Obviously I need a helper column but because the data is in different tables I'm not sure how to go about this. Any ideas?

 

Cheers

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Apologies...you need the INTERSECT function. As in

Mdoel.JPG

 

Create the measure :

Or filter =
COUNTROWS ( INTERSECT ( VALUES ( 'Ind OU'[OU] ), VALUES ( Computer[OU] ) ) )
    + COUNTROWS (
        INTERSECT ( VALUES ( 'Ind Users'[Username] ), VALUES ( Computer[Username] ) )
    )

Add the [Or filter] to the filter for the visual in the filter pane and set the value to greater or equal to 1:

Or.gifI've attached a sample PBIX file





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

4 REPLIES 4
PaulDBrown
Community Champion
Community Champion

Maybe...

Create a copy of the user table using 

Ind User = 'User'

and another for OU using

Ind OU = DISTINCT (Computer [OU])

 

Leave these tables unrelated. 
Create a measure along the lines of:

Row filter =

COUNTROWS(TREATAS(VALUES ( [Ind User [Username]), Computer[Usernme))

+
COUNTROWS(TREATAS(VALUES(Ind OU [Computer [OU]), Computer [OU]))

 

now add this [Row filter] measure to the filters for the visual in the filter pane and set the value to greater or equal to 1 and use the fields from the unrelated tables in the slicers





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thanks for the reply but I can't seem to get that to work, what do you think I'm doing wrong?

Apologies...you need the INTERSECT function. As in

Mdoel.JPG

 

Create the measure :

Or filter =
COUNTROWS ( INTERSECT ( VALUES ( 'Ind OU'[OU] ), VALUES ( Computer[OU] ) ) )
    + COUNTROWS (
        INTERSECT ( VALUES ( 'Ind Users'[Username] ), VALUES ( Computer[Username] ) )
    )

Add the [Or filter] to the filter for the visual in the filter pane and set the value to greater or equal to 1:

Or.gifI've attached a sample PBIX file





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thank you very much and for taking the time to provide the gif and pbix file.

 

Much appreciated.

 

Cheers

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.