DAX RELATED Function for Power BI – Lookup Into Table

Last modified date:

Function REALTED is very frequent and useful in DAX language. We can use it for example when we need to search table (A) for value from other table (B). And finding the according value is the exact task of this function.

Syntax is very simple:

How Come RELATED Function Needs Only 1 Parameter?

Data organization in Power BI consisting of tables connected in data model is the answer. And so because references exist between the tables, there is no need for the function to have multiple parameters. This is the difference compared to function VLOOKUP which needs 4 parameters.

When and How to Use Function RELATED in DAX?

The possibility to use the function is limited. We can use it only in case when we query into the table which returns only 1 value. In our case, we can only query from factual table FactInternetSales.

1) I create new column in this table and write a formula. You can see in the picture below how the function starts to automatically offer values from tables into which it sees.

DAX RELATED

2) I will let it add territory to every record on sales from table DimSalesTerritory using entry “RELATED(DimSalesTerritory[SalesTerritoryCountry])”

 

My name is Jan Zedníček and I work as a BI Developer at Kentico Software in Brno. Mostly you can see me there working in the office, but I also work partly as a freelancer. I have been working as a freelancer for many companies for more than 5 years, but Kentico is the matter of my heart. I used to work as a financial controller at companies like Aero Vodochody or Sberbank and I also used to be a bond program manager in Unicapital Investment group. When I am not at work, I like playing volleyball, chess, doing a workout in the gym and I enjoy tasting of best quality rums. I am trying to summarize all my knowledge on this website not to forget them (because of the rum effect, you know =) and to put them forward to anyone. Don´t worry about asking for help or writing some comments.

Category: DAX Tags: ,

About Ing. Jan Zedníček - BI Developer, Finance controller

My name is Jan Zedníček and I work as a BI Developer at Kentico Software in Brno. Mostly you can see me there working in the office, but I also work partly as a freelancer. I have been working as a freelancer for many companies for more than 5 years, but Kentico is the matter of my heart. I used to work as a financial controller at companies like Aero Vodochody or Sberbank and I also used to be a bond program manager in Unicapital Investment group. When I am not at work, I like playing volleyball, chess, doing a workout in the gym and I enjoy tasting of best quality rums. I am trying to summarize all my knowledge on this website not to forget them (because of the rum effect, you know =) and to put them forward to anyone. Don´t worry about asking for help or writing some comments.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.