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

Filtering Table based on field in another table

I have headcount data which includes the period, employee ID, employee name, job title, manager ID, and manager name.

 

I'm trying to create a visual where if an employee ID is filtered in Table 1, it will show me that employee's direct reports (those employees that have that employee ID as their Manager ID) in Table 2. I'm also trying to add a second filter on Table 2 to try to toggle between the periods. However, I for the life of me can't figure this out.

 

Below is an overview of the data set:

PeriodEmployee IDNameJob TitleManager IDManager Name
Jan-22001Employee 1CEON/AN/A
Jan-22002Employee 2Director001Employee 1
Jan-22003Employee 3Senior Analyst002Employee 1
Jan-22004Employee 4Senior Analyst002Employee 1
Jan-22005Employee 5Analyst002Employee 1
Feb-22001Employee 1CEON/AN/A
Feb-22002Employee 2Director001Employee 1
Feb-22003Employee 3Senior Analyst002Employee 2
Feb-22004Employee 4Senior Analyst002Employee 2
Feb-22005Employee 5Senior Analyst003Employee 2

 

Table 1

PeriodEmployee IDNameJob TitleManager IDManager Name
Jan-22001Employee 1CEON/AN/A
Feb-22001Employee 1CEON/AN/A

 

Table 2 (Ideal scenario)

PeriodEmployee IDNameJob TitleManager IDManager Name
Jan-22002Employee 2Director001Employee 1
Jan-22003Employee 3Senior Analyst002Employee 1
Jan-22004Employee 4Senior Analyst002Employee 1
Jan-22005Employee 5Analyst002Employee 1
Feb-22002Employee 2Director001Employee 1

 

Unfortunately, there is something that is preventing me from creating a relationship between Employee ID and Manager ID.

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @akhreis 

You can create a same table, but it does not have relationship with the original table.

then use the new table as table 1, the original table as table 2

then create a measure in original table"

Measure = IF(ISFILTERED('Table (2)'[Employee ID])=FALSE(),1,IF(MAX('Table'[Manager Name])=MAX('Table (2)'[Name]),1,0))

put the measure to the visual filter of table2

vxinruzhumsft_0-1673243809455.png

 

Output

vxinruzhumsft_1-1673243830103.png

Best Regards!

Yolo Zhu

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

View solution in original post

3 REPLIES 3
v-xinruzhu-msft
Community Support
Community Support

Hi @akhreis 

You can create a same table, but it does not have relationship with the original table.

then use the new table as table 1, the original table as table 2

then create a measure in original table"

Measure = IF(ISFILTERED('Table (2)'[Employee ID])=FALSE(),1,IF(MAX('Table'[Manager Name])=MAX('Table (2)'[Name]),1,0))

put the measure to the visual filter of table2

vxinruzhumsft_0-1673243809455.png

 

Output

vxinruzhumsft_1-1673243830103.png

Best Regards!

Yolo Zhu

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

Woohoo! Perfect!

Idrissshatila
Super User
Super User

Hello @akhreis ,

 

The try doing the relationship between employee ID from table 1 to employee ID from table 2.

 

If I answered your question, please mark my post as solution, Appreciate your Kudos👍

 

Follow me on Linkedin

 

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




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.