Introduction

Understanding the RELATED function in DAX is crucial for anyone working with Power BI. In this tutorial, we will explore the  RELATED function in depth, including its syntax, use cases and a practical example. Whether you are a beginner looking to improve your DAX skills or an advanced user preparing for Microsoft Exam PL-300 (Power BI Data Analyst), mastering the  RELATED function will help you build more insightful and dynamic reports.

The RELATED function in DAX fetches a value from a related table based on an existing relationship between the tables. It allows you to retrieve a single value from a column in another table that is connected through a relationship.

💡
The RELATED function only works with an existing many-to- one-relationship from the current table to the related table that contains the relevant information.

Syntax

The syntax of the RELATED function looks as follows:

RELATED(<column>)

Let's look at the components in detail:

<column> name of the column from the related table you want to retrieve the value from.

Practical Example

Now, let's perform an example calculation with the RELATED function.

Step 1: Import sample data

The data for this tutorial comes from two Excel files:

  • student.xlsx: Contains student information
  • exam_results_data_science.xlsx: Contains exam results for Data Science courses

If you don't know how to import data from an Excel file into Power BI, check out the following tutorial:

Power BI - Import Data from Excel file
Introduction In this tutorial, we want to import Data from a Excel file into Power BI. This can be easily done in the Power BI Desktop interface. Data Source Our data source is the Excel file student. The file contains the following data: Power BI Desktop In the following, we

We have loaded the data into Power BI without executing any transformations. The data looks as follows:

exam_results_data_science

student

Step 2: Ensure table relationship

Make sure that the table exam_results_data_science is connected to the table student with a many-to-one relationship.

You can view this post with the tier: Academy Membership

Join academy now to read the post and get access to the full library of premium posts for academy members only.

Join Academy Already have an account? Sign In