Here's an example using the AdventureWorksDW data set...
EVALUATE(
CALCULATETABLE(
ADDCOLUMNS(
'Internet Sales'
,"Order Calendar Year"
,CALCULATE(VALUES('Date'[Calendar Year]))
,"Ship Calendar Year"
,CALCULATE(
VALUES('Date'[Calendar Year])
,FILTER(
'Date'
,'Date'[DateKey] = 'Internet Sales'[ShipDateKey]
)
)
,"Due Calendar Year"
,CALCULATE(
VALUES('Date'[Calendar Year])
,FILTER(
'Date'
,'Date'[DateKey] = 'Internet Sales'[DueDateKey]
)
)
)
)
)
This code pulls in Calendar Year from the Date table to the Internet Sales table for each of the dates in the Internet Sales table:
- Order Date (active relationship)
- Due Date (inactive relationships)
- Ship Date (inactive relationships)
EDIT: corrected first response (above)...Here's a good write up of why USERRELATIONSHIP won't work in this scenario:
The LOOKUPVALUE below works as well:
=LOOKUPVALUE(
People[FullName]
,People[PersonID]
,FollowUps[OwnerID]
)