Forum Discussion
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_ID | Observation_ID | Supervisor_ID |
| 1111 | ABC | 9999 |
| 2222 | DEF | 8888 |
| 3333 | GHI | 7777 |
Contact Table
| Employee_ID | Employee_Type |
| 1111 | Employee |
| 2222 | Employee |
| 3333 | Employee |
| 9999 | Supervisor |
| 8888 | Supervisor |
| 7777 | Supervisor |
5 Replies
- lbendlin
Super User
Recommend you read about the PATH functions in DAX.
- tomperro
Helper 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
Super 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.
- Ashish_Mathur
Super User
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.