Forum Discussion
USERELATIONSHIP do not work anymore
- 6 years ago
Anonymous , Yes. That is the problem. Create a date column and join that with date table
TASK Date = [TASK Created].Date
Hi, Anonymous
Please make sure date type of the two columns from two tables are both the same. About USERELATIONSHIP function, please refer to the document .
USERELATIONSHIP(<columnName1>,<columnName2>)
<columnName1> usually represents the many side of the relationship to be used. This argument cannot be an expression.
<columnName2> usually represents the one side or lookup side of the relationship to be used. This argument cannot be an expression.
I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
Calendar(a calculated table):
Calendar = CALENDARAUTO()
Here are the relationships. 'StartDate'<->'Calendar' relationship is active. 'EndDate'<->'Calendar' is inactive.
You may create two measures as below.
RelationStart =
CALCULATE(
SUM('Table'[Value]),
USERELATIONSHIP('Table'[StartDate],'Calendar'[Date]),
MONTH('Calendar'[Date])>7
)
RelationEnd =
CALCULATE(
SUM('Table'[Value]),
USERELATIONSHIP('Table'[EndDate],'Calendar'[Date]),
MONTH('Calendar'[Date])>7
)
It works for 'RelationEnd' which use an inactive relationship, where <columnName1> and <columnName2> have the right order.
When i reverse the order of two parameters, 'RelationEnd' doesn't work
RelationEnd =
CALCULATE(
SUM('Table'[Value]),
USERELATIONSHIP('Calendar'[Date],'Table'[EndDate]),
MONTH('Calendar'[Date])>7
)
So please make sure <columnName1> and <columnName2> have the right order.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
Hi v-alq-msft, thank you fro the answer.
I did as you said and it still doesn't work. I will keep looking for a solution.
Best regards,
Samuel.