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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Oros
Post Partisan
Post Partisan

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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