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
Oros
Post Prodigy
Post Prodigy

Relating different tables

Hello,

 

Would anybody know how to build this results table below using the product discount, customer and sales tables?  How do you relate these 3 tables and what formula/statement to use?  Thanks.

 

RESULTS TABLE

Customer#Discount LevelProduct #Special Price
Cust 1BronzeB1$30
Cust 1BronzeB3$5
Cust 2GoldB2$100
Cust 2GoldB1$10
Cust 3SilverB3$3



PRODUCT DISCOUNT TABLE

Product #Discount LevelSpecial Price
B1Bronze$30
B1Silver$20
B1Gold$10
B2Bronze $150
B2Silver$125
B2Gold$100
B3Bronze$5
B3Silver$3
B3Gold$1

 

CUSTOMER TABLE

Customer Discount Type
Cust 1Bronze
Cust 2Gold
Cust 3Silver

 

SALES TABLE

CustomerProduct #
Cust 1B1
Cust 1B3
Cust 2B1
Cust 2B2
Cust 3B3
1 ACCEPTED SOLUTION

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Merge Table 2 into Table 3 based on the Customer column to bring over the Discount type column into Table 3.  Merge Table 3 into Table 1 based on the Product # and Discount type column to bring over the Customer in Table 1.  Now build all your visuals from Table 1.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur ,

 

Thank you for your quick reply.  In merging table 3 into table 1, what do you mean by based on Product # AND Discount Type column?  How do you achieve this merging using in a query, based on 2 columns? Thanks again.

Hi,

In the Query Editor, select Merge queries and then select the common columns of both tables.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks @Ashish_Mathur 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.