RELATED DAX Function in Power BI

The RELATED function in DAX is used to fetch a value from a related table which is “one” side of a relationship in a one-to-many or many-to-one relationship. We can access any column value from the related table. It works in a row context and returns a single value of any type that is related to the current row from another table.

DAX Syntax RELATED(column)

The parameter column is the column that contains the values we want to retrieve.

Example: Let’s we have the following data model in the power bi.

RELATED dax function in Power BI

We can see that the “Branch Table” is related to the “Students Table” by the “ID No” and “Branch ID” column respectively. The relationship between Branch Table and Students Table is one-to-many.

Let’s see the “Branch Table”.

RELATED dax function in Power BI

Let’s see the “Students Table”.

RELATED dax function in Power BI

Ley’s create a new column in the “Students Table” that refers the values from the related table i.e. “Branch Table” based on the relationship between the two tables. Click on New Column to create a calculated column in the table.

RELATED dax function in Power BI

When we are going to create the column in the intellisense it shows us both the table the “Branch Table” and the “Teacher Table”. Because “Teacher Table” also filters the “Branch Table”. So, we can say the Related function can get the value from the propagated filtered table also provided the table has on the “one” side of a relationship.

DAX

Column = RELATED('Branch Table'[Branch])

The output of the above dax code is shown below:

RELATED dax function in Power BI

Let’s create another column in the table.

DAX

Column 2 = RELATED('Teacher Table'[Associated Teacher])

The output of the above dax code is shown below:

RELATED dax function in Power BI