Forum Discussion
Userelationship return all values for each row
Can userelationship return anything other than an aggregate?
i am trying to get each employee name from my employee table using an inactive relationship.
Hello tomperro
Yes,
Use CALCULATE and VALUES or SELECTCOLUMNS to get individual values.
Thanks,
Pankaj Namekar | LinkedInIf this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.
5 Replies
- pankajnamekar25
Super User
Hello tomperro
Yes,
Use CALCULATE and VALUES or SELECTCOLUMNS to get individual values.
Thanks,
Pankaj Namekar | LinkedInIf this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.
- tomperro
Helper V
Would you be able to give me an example of how the dax should look?
thank you in advance
- danextian
Super User
If you mean by "each employee" all values, you can't do that with a calculated column or a measure. They must always return a scalar value - aggregate or concatenated values. You can return each employee in a separate table.
- v-achippa
Community Support
Hi tomperro,
Thank you for reaching out to Microsoft Fabric Community.
Thank you pankajnamekar25 for the prompt response
The USERELATIONSHIP function in DAX can be used to activate an inactive relationship between tables, which can then be used in your calculations.
Here’s an example measure that demonstrates how to use USERELATIONSHIP to get a list of employee names using an inactive relationship:
USERELATIONSHIP activates the inactive relationship between Employee[EmployeeID] and Department[EmployeeID]. Normally, the active relationship may be between Employee[DepartmentID] and Department[DepartmentID].
EmployeeNames =
CALCULATETABLE (
Employee[EmployeeName],
USERELATIONSHIP (Employee[EmployeeID], Department[EmployeeID])
)If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks and regards,
Anjan Kumar Chippa
- v-echaithra
Community Support
Hi tomperro ,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.Regards,
Chaithra.