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
CLCastroEn
Helper IV
Helper IV

how to relate two databases

Hello everyone!

I am working with a database that has the following data:

SKU, Store, Week, CLiente, , Category and Family. Where category and family are logically SKU hierarchies. The thing is, I have another database that only brings SKUs, Customer, Week, Sales 2019, and Sales 2020.

When making the relationship in power BI, I make a relationship with the common point (SKU), which is a many-to-many relationship because on both bases there are duplicate skus (a sku can be equal for two or more customers). I made the relationship because I need to know the sales of 2019 and 2020 by SKU (which in a way I think works for me) but when I put a category filter, the tables do not move and there is a constant value that obviously did not work the filter. They can help me with relationship building!

CLCastroEn_0-1604489393654.png

where "Internal Code" in table "sheet1" is the same as "material" in the "base" table, the relationship is many to many.

2 REPLIES 2
amitchandak
Super User
Super User

@CLCastroEn , maybe you try a composite key and try to make it one to many

example

key = [SKU] & " " & [Year]

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak Hello! but anyway it would be several to several. because on both bases the SKU is repeated for different weeks, different customers.

Maybe if I create a table with the composite key "SKU & Year & Customer" where there are only unique values? Some kind of bridge between the two bases and there if the one-to-many relationship would work?

Best regards

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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.