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
greglauder
New Member

Merging Two Tables

Hi

 

I'm having trouble merging information into one table on power BI. 

 

I have 3 tables which I work from which I work from

 

1. Policy

2. Motor Drivers

3. Motor Vehicles

 

They all have a common field which is the unique policy reference number e.g. GREG-1001. I've managed to create the following 2 relationships:

 

  • Policy & Motor Drivers
  • Policy & Motor Vehicles

However when I try to create a relationship between Motor Driver & Motor Vehicle it comes up with the an error message stating "Can´t create a relationship between two columns because one of the columns must have unique values"

 

In the motor drivers column there can be more than one row per unique reference number if there is more than one driver.

 

Can anyone help regarding this?

 

Thanks

Greg 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

if you're trying to normalize the data into 1 table, I recommending using the "Merge Queries" button in Query Editor to perform the merge and get the columns that you need into 1 data table.

 

Relationships in Power BI should be used as a way to link a dimension table to a fact table.

 

It sounds like you have 2 fact tables, and these should never have a relationship joining them.

View solution in original post

3 REPLIES 3
anandraman
Helper I
Helper I

Try Policy as BRIDGE TABLE in relationship

 

 

POLICY MOTOR------POLICY-------------POLICYVEHICLE

                            M:1                   1:M

 

And while creating the report pull the policy Number from POLICY table as well.

v-yulgu-msft
Employee
Employee

Hi @greglauder,

 

I guess you have created a one to many relationship for Policy & Motor Drivers and Policy & Motor Vehicles. That case, there existing a indirect many to many relationship between Motor Drivers and Motor Vehicles. It is not able to establish a many to many relationship. So, if you want to merge Motor Drivers and Motor Vehicles, you could try ChrisHaas's suggestion that use the "Merge Queries" button in Query Editor.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

if you're trying to normalize the data into 1 table, I recommending using the "Merge Queries" button in Query Editor to perform the merge and get the columns that you need into 1 data table.

 

Relationships in Power BI should be used as a way to link a dimension table to a fact table.

 

It sounds like you have 2 fact tables, and these should never have a relationship joining them.

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.