USERELATIONSHIP DAX Function in Power BI
The USERELATIONSHIP DAX function enables the relationship to be used in a specific calculation as the one that exists between columnName1 and columnName2. It does not return any value.
DAX Syntax USERELATIONSHIP(columnName1,columnName2)
The function has the following parameters:
• columnName1: The name of an existing column, using standard DAX syntax and fully qualified, that usually represents the many side of the relationship to be used; if the arguments are given in reverse order the function will swap them before using them. This argument cannot be an expression.
• columnName2: The name of an existing column, using standard DAX syntax and fully qualified, that usually represents the one side or lookup side of the relationship to be used; if the arguments are given in reverse order the function will swap them before using them. This argument cannot be an expression.
Example: Let’s we have the following data model in Power BI.

There are two relationships between the Countries and Students Data table. One is Active and the other is Inactive.

Let’s we have the following data in the “Students Data” table.

Let’s create a measure named “Country Relationship Measure”.
DAX
It gives the sum of 10th Marks column of the Students Data table.
Let’s create another measure “Year Relationship Measure”.
DAX
It also gives the sum of 10th Marks column of the Students Data table by using the inactive relationship between the Year column of the Countries tables and the Year of Passout column of the Students Data table.
Let’s select the England value from the country slicer, as shown in the image below:

We can see that the table is filtered based on the selected country value, the sum of the 10th Marks column value is 1508.
We can see that the Year slicer is also filtered as it is also coming from the same table.

Let’s filter the table Students Data column Year of Passout with value 2022.

We can see in the image above the “Year Relationship Measure” returns 1219 (753 + 466).