Forum Discussion
USERELATIONSHIP with DATEDIFF
Hello Community - The VAR statment is what I am trying to understand here, in my calculated column. I am not getting any errors in the formula itself (no red lines, etc), but when I go to save it, I get an error saying the USERELATIONSHIP function can only be used in the CALCULATE function. I do have it wrapped in a Calculate function, so not clear how to correct?
4 Replies
- AlexisOlsonSuper User
The USERELATIONSHIP does not belong inside DATEDIFF. Try this instead:
CALCULATE ( DATEDIFF ( 'Dim_Date Table'[Date], TODAY (), DAY ), USERELATIONSHIP ( 'Dim_Date Table'[Date], 'Sf_Opportunity Line'[Customer_Requested_Ship_Date__c] ) )- AnonymousNot applicable
AlexisOlson I tried your measure but unfortunatley the intellisense won't pick up the dim_date table (date) column.
- AlexisOlsonSuper User
OK. Can you explain why you're trying to use the USERELATIONSHIP function in what appears to be a calculated column?
Do either of these work instead of the CALCULATE expression I gave previously?
DATEDIFF ( 'Sf_Opportunity Line'[Customer_Requested_Ship_Date__c], TODAY (), DAY ) DATEDIFF ( RELATED ( 'Dim_Date Table'[Date] ), TODAY (), DAY )If not, why not?