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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.