Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Salac
Regular Visitor

Limited relationship issue

Hi all,

 

I read all the topics related to this issue but I couldn't resolve the issue that I'm struggling with. I have two tables (one for promo plan, other for results), but they don't have distinct data I can use to make a relationship. So I created a key by merging two columns (promotion week number and Product ID), because those data are the same at both tables. But when I make a connection, it shows the sentance "The relationship has cardinality Many-Many..." but it cannot be. And the relationship looks broken. So I can't use Related function and I need it to retreive some data from one table and use it with data from the other one.

 

Can somebody please help me, I've lost a couple of days trying to resolve this issue?

This is the key - red part is the week number and a year, then comes the "." and then article ID. It's the same with the other table.

Salac_0-1733995712219.png

This is just an example of DAX that won't work, but it's the same no matter which DAX formula I use with "related" function.

Salac_1-1733995950655.png

 

Salac_2-1733996021096.png

 

Please help!!!

 

3 ACCEPTED SOLUTIONS
Tahreem24
Super User
Super User

@Salac If you don't have unique values in any tables so try creating a Bridge Table as below:

 

Bridge Table = DISTINCT(TableName [Key NB])

 

Then join this Bridge table to both of the remaining tables.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

Related Function always work in the table that is at many side of the relationship . so there should be one to many relationship b/w the tables.
Try creating a Bridge table for storing unique records and then connect that table to both the tables 
using one to many relationship.

 

View solution in original post

johnt75
Super User
Super User

I think that the problem is you have values in both tables which don't appear in the other table, resulting in a blank row being added to both and a many-to-many relationship.

The easiest solution would be to use LOOKUPVALUE rather than RELATED, using your key column to do the lookup.

View solution in original post

7 REPLIES 7
Salac
Regular Visitor

Thank you all!
Both of the solutions were actually helpful!

johnt75
Super User
Super User

I think that the problem is you have values in both tables which don't appear in the other table, resulting in a blank row being added to both and a many-to-many relationship.

The easiest solution would be to use LOOKUPVALUE rather than RELATED, using your key column to do the lookup.

Salac
Regular Visitor

Sure 🙂

Table 1 contains planned promotions for 3 years in the past. Some articles have been promoted multiple times, so I can't use article id as a key. But those articles have been promoted in different weeks/years, so I merged those two columns into one. 

Column 1  (week number / year)

Salac_3-1733996929081.png

 

Column 2 (article id)

Salac_4-1733996947145.png

 

Column 3 (merged column)

Salac_2-1733996896483.png


The other table has the same columns and the same merged column. 
I tried to connect them (create a relationship), as it suppose to be unique values in Key column (in both tables). But the relationship is not complete, and Related function doesn't work. How, why? What am I doing wrong?

Hi, @Salac 

 

Can you provide more example data and what you expect the output to be?

How to provide sample data in the Power BI Forum - Microsoft Fabric Community

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Related Function always work in the table that is at many side of the relationship . so there should be one to many relationship b/w the tables.
Try creating a Bridge table for storing unique records and then connect that table to both the tables 
using one to many relationship.

 

Tahreem24
Super User
Super User

@Salac If you don't have unique values in any tables so try creating a Bridge Table as below:

 

Bridge Table = DISTINCT(TableName [Key NB])

 

Then join this Bridge table to both of the remaining tables.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
govind_021
Resolver II
Resolver II

Hi , can you provide more clearity by adding images of the problem.

 

Helpful resources

Announcements
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.