Many to Many Relationship between same two tables- Related function not using the second relationship

Mavericks334

Active Member
Joined
Jan 26, 2011
Messages
280
Hi,

I have a Tables called Data & Employee.

The common Field is the employee Name.

In the Data Table, i have Preparer and Reviewer in two seperate Columns, and in the Employee i have the name of the employee and supervisor.

I need to get the supervisors name for both the preparer and reviewer. When i use related it gives me the only the supervisors for Preparer.

How could i get the supervisors name for the reviewer.

There is a relationship between Preparer and Employee and Reviwer and Employee.

Regards,
Renato.
 
I assume you have your Employee table as follows:
Employee {ID, Employee Name, Supervisor}

Your table with your data:
Data {Preparer, Reviewer, ...}


And you have the appropriate active (Preparer) and inactive (Reviewer) relationships.

Measure As Preparer:=YourExpression

Measure As Reviewer:=CALCULATE(
YourExpression
,USERELATIONSHIP(Data[Reviewer],Employee[Employee Name])
)

Measure in all roles:= [Measure As Preparer] + [Measure As Reviewer]
Now, the following should look fine:
Employee[Employee Name], [Measure As Preparer],[Measure As Reviewer]

This should also work for:
Employee[Supervisor], [Measure Preparer],[Measure Reviewer]

You should not try to add a calculated column to your Data table to do that. This is what your dimensions are for.
 
Last edited:
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,224,875
Messages
6,181,516
Members
453,050
Latest member
Obil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top