Forum Discussion

coolshib's avatar
coolshib
Helper III
6 years ago
Solved

Need help to compare two tables using multiple criteria

Hello Everyone,

I have following tables

 

Location: 1
CompanyProductSale
ABCApple100
XXXOrange200
YYYPear300
ZZZBanana400

 

Location: 2
CompanyProductSale
ABCApple300
XXXOrange150
YYYPear200
ZZZBanana450
XYZCherry800
DYBPlum200
ZYXGuava500

 

Now i need to compare product wise company wise total sales of location 1 with location 2.

 

CompanyProductSales Location 1Sales Location 2
ABCApple  
XXXOrange  
YYYPear  
ZZZBanana  

 

Many Thanks in advance.

Best Regards,

Shib

 

 

 

  • Anonymous's avatar
    Anonymous
    6 years ago

    coolshib 

    Once you have created a relationship between the tables, you could create measure that returns the sales in location 2. 

     

     

    Sale location2 = CALCULATE(SUM(Location2[Sale]),
    FILTER(Location1,Location1[Product] in VALUES(Location2[Product])),
    FILTER(Location1,Location1[Company] in VALUES(Location2[Company])))

     


     

    Paul Zheng

3 Replies