With the help of the RELATED function in Power BI, users can establish connections between two data tables for better analytical feedback.
But this vital feature can sometimes go wary without any warning or explanation. The only way to get out of this situation is by debugging the relationship properly, but that’s easier said than done.
So, to help you out, I have thoroughly addressed the precise reasons, along with corresponding solutions, for the RELATED function not working issue.
Let’s get started.
Why is the RELATED Function Not Working in Power BI?
The RELATED function in Power BI is a DAX (Data Analysis Expressions) function that allows users to retrieve a single value from a related table based on a defined relationship. Hence, this function won’t work if there is no predefined relationship between the referred tables.
Syntax for the RELATED function:
=RELATED(table[column]).
In short, as the name suggests, the RELATED function requires users to establish a data model relationship between the current table and the table from where the related data needs to be fetched.
This lack of relationship can be boiled down to various reasons like incorrect column configuration or data island issues.
Here’s why the RELATED function is not working in Power BI:
- Related column values do not match.
- Trying to establish a relationship between the wrong fields.
- Data values missing.
- Using many-many relationship, which is not supported by the RELATED function.
Keep in mind, the aforementioned issue is not a technical limitation or software-related problem. The RELATED function just won’t work if you haven’t configured the active relationship line between the two tables properly.
How to Debug Power BI RELATED Function Not Working Issue
The best way to debug your Power BI data model is by going through the fundamental steps and making sure they meet the parameters to apply the RELATED function. These parameters are basically the parameters of relationship between two tables.
Below, I have discussed all the necessary checks and fixes for resolving the RELATED function error in Power BI. So, carefully follow each step, and don’t skip over any important method.
Here’s how to fix Power BI RELATED function not working issue:
1. Establish Relationship with the Correct Column/Field
Power BI users have to create at least one relationship line between the available/targeted data tables before they can use the RELATED formula. And during this relationship creation process, it is vital to select the correct columns between the two tables to get a valid return.
Hence, if you can’t use the RELATED function in your project/report, click on the relationship line in the Model view and check if you’ve selected the same columns from the data model.
In case you’ve selected the wrong columns participating in the relationship, you can either delete the relationship and re-create it properly, or you can click on the relationship line and modify it from the Properties.
For example, I have two data tables in a relationship with the Product name column, as shown in the Properties section. If any of the tables had a different selected column, say Price, then the RELATED function wouldn’t work as it wouldn’t even have a proper connection.
While you’re at it, make sure to select the correct data island, insert correct values that match two tables, and modify any missing values if you can’t establish a proper relationship.
2. Match the Correct Column Values
When you’re using the RELATED formula, make sure you’re using the column values of the fact table and the lookup table matches. For example, you can’t use the sellers’ names to relate to the product prices.
Such an issue occurs due to bad data import from the source model or typing errors.
Hence, you need to make sure you select the same column value, like Product Price with Units Cost, to use the RELATED function.
For demonstration, I have chosen the Unit Costs column to relate with the fact table’s Price column with Units Cost = RELATED(‘Price'[Price]) formula.
3. Use the Correct Relationship(One to Many) for RELATED Function
One important thing to keep in mind while using the RELATED formula is that it can’t use a many-to-many relationship between data tables. To use this function, you need to establish a one-to-many or one-to-one relationship.
In my case, the relationship between the two tables has been set to 1:* or one-to-many. Hence, I can use the aforementioned formula without any issues.
But not all data can have the 1:* cardinality, can it?
So what can you do when the Power BI relationship is not working & the app shows that the columns can only use the many-to-one/many-to-many relationship?
For such instances, you can use Power Query to connect the two tables or use the VLOOKUP DAX function, which is a bit more complicated process.
To Conclude
After all things said and done, establishing a proper relationship between the tables and using the proper DAX function is the best way to make sure that the Power BI RELATED function not working issue resolves effortlessly.
For any confusion or assistance related to MS Power BI, feel free to visit our website. We have covered pretty much every crucial aspect to boost your productivity.
Anyway, that’s it for today. Have a good day!