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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Data Modeling

Hi

I would like to ask how to solve my problem

I have a two tables :

 

sql.JPG

 

How can I create a relationship between the two table? Power BI doesnt allow me to use invoice_id because it should be unique. I need to fix it because if I join the tables via SQL query it makes double the value of invoice_amount and contract_amount on the graphs

 

Please advise. Thank you!

 

Regards,
Arvin

1 ACCEPTED SOLUTION
ankitpatira
Community Champion
Community Champion

@Anonymous For you to be able to create relationship between two tables you certainly need unique values in one column much like PK FK relations. So if values in your table 1 are not unique you should via query editor remove duplicate values and then create relation from table 1 to table 2.

View solution in original post

1 REPLY 1
ankitpatira
Community Champion
Community Champion

@Anonymous For you to be able to create relationship between two tables you certainly need unique values in one column much like PK FK relations. So if values in your table 1 are not unique you should via query editor remove duplicate values and then create relation from table 1 to table 2.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.