Forum Discussion
USERELATIONSHIP with TEXT
Hi All,
I am trying to use USERELATIONSHIP but it's not behaving as expected
Table Used
Table1 - Id_child, Id_parent : Fact table
Table2 - id, name : Dim table
Existing relationships:
Table1.id_child *:1 Table2.Id_child (Active)
Table1.id_parent *:1 Table2.Id_child (In-Active)
Cardinality
Many to one (*:1)
Cross filter direction
Single
Problem statement
I want to populate names in Table1 using USERELATIONSHIP DAX function
Child Name = CALCULATE(VALUES(Table2[name]),USERELATIONSHIP('Table1'[Main Issue],Table2[issue_id]))
Parent Name = CALCULATE(VALUES(Table2[name]),USERELATIONSHIP('Table1'[Link Issue],Table2[issue_id]))
But both the formula's giving same output, I know this could have been done using LOOKUP or other function, but I wanted to explore .
Any special configuration is required to use USERELATIONSHIP?
1 Reply
- amitchandak
Super User
Anonymous , Make sure both are measures with small change
Child Name = CALCULATE(count(Table2[name]),USERELATIONSHIP('Table1'[Main Issue],Table2[issue_id]))
Parent Name = CALCULATE(count(Table2[name]),USERELATIONSHIP('Table1'[Link Issue],Table2[issue_id]))
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.