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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
tiberiomena
New Member

How to merge tables that have two keys

Hi guys, how are you?

 

I've been trying to merge two tables, but both of them have two keys. In SQL it's easy to do that with select * from... but it seems that Power BI can't.

 

This are my tables: A is a product sales (with date of sale), and B is service sales (with date of service). I want to merge these two tables since product service retentions depends on what product were sold. I attached a image for reference:

 

Two keys tables.PNG 

 

As you see, I want to know what sales and service were done monthly, by customer.

 

Please, your help will be greatly appreciated.

 

Regards,

 

Alexis

1 ACCEPTED SOLUTION
SivaMani
Resident Rockstar
Resident Rockstar

@tiberiomena,

 

As per your requirement,

  1. Generate Date table
  2. Dimension table for Vendor

Join the above table with TableA and TableB

 

Join.PNG

 

Merge.PNG

 

View solution in original post

2 REPLIES 2
SivaMani
Resident Rockstar
Resident Rockstar

@tiberiomena,

 

As per your requirement,

  1. Generate Date table
  2. Dimension table for Vendor

Join the above table with TableA and TableB

 

Join.PNG

 

Merge.PNG

 

Anonymous
Not applicable

Many-Many relationship is not supported in power BI. Hence you cannot merge Table A and table B. Instead you can try the alternate by having a master table for Vendor(i guess you are using the Vendor field to merge the two tables in SQL) 

1) Create a query in Power BI to get the distinct Vendor from Table A and table B and the name resulting table as VendorMaster

2)Create relationship within PowerBI VendorMAster->TableA and VendorMaster->TableB

Then you can create a measure to get the required result

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors