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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to create correct relation ship between tables?

Hello!

 

I created a relationship between tables, but something is wrong.

So I have following tables:

1. "Perspective product" with column "Product" - has 50 unique products.

2. "Correlation" with columns "Product", "Close product", "Correlation coeff-s" - "Product" and "Close products" columns have same values, while "Correlation coeff-s" has coefficients between products from two columns. this table used to see "Close products" and their correlation coefficients when product is selected from the 1st table "Perspective product".

3. "SITC" table with columns "Product code", "Product Name" - contains product codes and their names. Here are approximately 1000 products (unique). "Perspective product" contains only 50 of these products, so they are the same products. I have connected the Product code with  "Perspective product"[Product] to obtain product names and their export values. SITC["Product code'] is connected with a table that has Export values for products.

 

My question is how can I get product name and export values for the Correlation[Close product] column? My idea is to see Close products with coefficients and their export values for each Product from the Perspective products table. 

 

So far I tried:

1. I tried to create an inactive relation between Correlation[Close product] and SITC[Product code] and USERELATIONSHIP, but it gives me the wrong values.

2. I duplicated the "SITC" table and connected it separately to the Correlation[Close product] and to the Export values and as result it is s showing incorrect data.

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

If you want to get the value in a table from a table that is not related and it’s impossible to create a relationship between them, you can try to use the NATURALLEFTOUTERJOIN or NATURALINNERJOIN function in DAX to relate the table manually.

 

Or you can go to the Power query to use the Merge query to merge the two tables to get the ideal columns:

v-robertq-msft_0-1620614166253.png

 

https://blog.enterprisedna.co/how-to-merge-queries-in-power-bi/

 

Best Regards,

Community Support Team _Robert Qin

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

View solution in original post

1 REPLY 1
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

If you want to get the value in a table from a table that is not related and it’s impossible to create a relationship between them, you can try to use the NATURALLEFTOUTERJOIN or NATURALINNERJOIN function in DAX to relate the table manually.

 

Or you can go to the Power query to use the Merge query to merge the two tables to get the ideal columns:

v-robertq-msft_0-1620614166253.png

 

https://blog.enterprisedna.co/how-to-merge-queries-in-power-bi/

 

Best Regards,

Community Support Team _Robert Qin

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.