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
Danial26
New Member

Filter rows based on 2 related tables

Hi There,

So I have 2 tables with the same unique ID. Both tables has a column called department name. The Business logic behind both tables are as below:

Table B can have a value of Department 1 but have have 2 different Department Value in Table A. 

Table A can have a value of Department 1 but Have no Values at all in Table B

 

Table A:

ID

Department Name

1

Dep1

2

Dep2

3

Dep3

4

Dep1

 

Table B:

IDDepartment Name
1Dep1
2Dep1
3Dep3


So I would like to create a table visuals in PowerBI that has filter out the row of Filter A Based on the column from Table B that has a value of Dep1 and also Value of Dep1 In Table A

 

ID (From Table A)Department Name
1Dep1
2Dep2
4Dep1

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@Danial26 , Create a slicer based on Table A dept

 

Create a measure and add it to the visual having column from table 2 or use it as a visual level filter

 

measure = calculate(countrows(Table2), filter(Table2, Table2[dept] in values(Table1[Dept]) ) )

Hi @amitchandak , I am so sorry but I was editing my post and before I managed to post it, you manage to answer it. There is another condition that I have added. Do you think it will work with the added conditions? so sorry again as I am new to the community 

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.