Forum Discussion

akhreis's avatar
akhreis
New Member
3 years ago
Solved

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.

  • Anonymous's avatar
    Anonymous
    3 years ago

    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

     

    Output

    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.

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    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

     

    Output

    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.

  • 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