Forum Discussion
DominicBrien
9 years agoFrequent Visitor
Cross table Datediff
Hello, Lets say I have a person table where I can find date of birth for every person in the system. I also have an event table where I can find the date an event occured at and another field that ...
- 9 years ago
What’s the warning message when you try including “RELATED” in the calculate column expression?
If Event and Contacts table has relationship with the PersonID key, you should be able to get the desired result with following column formula.
Age = IF ( ISERROR ( DATEDIFF ( Event[Date], RELATED ( Contacts[DateOfBirth] ), YEAR ) ), DATEDIFF ( RELATED ( Contacts[DateOfBirth] ), Event[Date], YEAR ) )Best Regards,
Herbert
v-haibl-msft
9 years agoMicrosoft Employee
What’s the warning message when you try including “RELATED” in the calculate column expression?
If Event and Contacts table has relationship with the PersonID key, you should be able to get the desired result with following column formula.
Age =
IF (
ISERROR ( DATEDIFF ( Event[Date], RELATED ( Contacts[DateOfBirth] ), YEAR ) ),
DATEDIFF ( RELATED ( Contacts[DateOfBirth] ), Event[Date], YEAR )
)
Best Regards,
Herbert