Forum Discussion

tomperro's avatar
tomperro
Icon for Helper V rankHelper V
2 years ago

How to create a relationship to two different tables

I have two tables that I need to create two seperate relationships between and I am not sure how to accomplish this.

 

I have a Contact Table with a list of employees and the type of employee they are.

 

The other table is an Observtion Table that includes observations that a supervisor has done on an employee.

 

I need to relate these tables 2 ways.

1. Observation.Employee_ID to Contact.Employee_ID - to see what observations have been done on the employee.

2. Observation.Supervisor_ID to Contact.Employee_ID - to see what observations a supervisor has completed.

 

My workaround was to create two contact tables, one for the employee and one for the supervisor but this seems excessive.

 

Observation Table

Employee_IDObservation_IDSupervisor_ID
1111ABC9999
2222DEF8888
3333GHI7777

 

Contact Table

Employee_IDEmployee_Type
1111Employee
2222Employee
3333Employee
9999Supervisor
8888Supervisor
7777Supervisor

5 Replies

  • Recommend you read about the PATH functions in DAX.

    • tomperro's avatar
      tomperro
      Icon for Helper V rankHelper V

      Im not sure if path is what I am looking for.  I nned to run reports of employees that have received tests but also run seperate report of tests the supervisors have done.
      The test table has employee id, who the test was done on and supervisor id, who did the test.
      I need to link the test table back to my contact table to get employee and supervisor information.

      • lbendlin's avatar
        lbendlin
        Icon for Super User rankSuper User
        - to see what observations have been done on the employee.
        - to see what observations a supervisor has completed.

        Those requirements don't seem to need the Contact table.

  • Hi,

    One of those relationships should be inactive.  In the measure we will then have to use the USERELATIONSHIP() function to active the inactive relationship.  I can offer more help, if you show the expected result.