Reply
Oros
Post Prodigy
Post Prodigy
Partially syndicated - Outbound

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

Syndicated - Outbound

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/

Syndicated - Outbound

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.

Syndicated - Outbound

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/

Syndicated - Outbound

Thanks @Ashish_Mathur 

Syndicated - Outbound

You are welcome.


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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)