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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
MarkJ09
Frequent Visitor

Joining / filtering between two columns, different tables

 

Hello,

 

I have one table that contains product information, all unique values:

01-Hammer

02-Screwdriver

03-Wrench

 

I have two other tables, one that contains customer info

Customer A, 01-Hammer, 5 orders

Customer B, 03-Wrench, 2 orders

Customer C, 03-Wrench, 14 orders

Customer A, 02-Screwdriver, 20 orders

 

and another that contains external market data :

CityA, 01-Hammer, 80 orders

CityB, 01-Hammer, 35 orders

CityA, 02-Screwdriver, 130 orders

City B, 02-Screwdriver, 70 orders

 

Both of these tables connect to my first table in a many to one relationship. I pull these last two tables together to get our data vs market data:

01-Hammer, 200 orders (our company), 1500 orders (market)

02-Screwdriver, 100 orders (our company), 1000 orders (market)

03-Wrench, 100 orders (our company), 500 orders (market)

 

And created a measure for our data and market data to calculate percentage of total products, as well as the difference:

01-Hammer. 200 orders (our company), 50%, 1500 orders (market), 20%, 30%

02-Screwdriver, 100 orders (our company), 25%, 3000 orders (market), 30%, -5%

03-Wrench, 100 orders (our company), 25%, 5000 orders (market), 50%, -25%

 

The measures I used:

Measure1 = divide(CALCULATE(Count(OurData[ID])),calculate(COUNT(OurData[ID]),all('OurData'[ProductInfo])))
Measure2 = divide(CALCULATE(Count(Market[ID])),calculate(COUNT(Market[ID]),all('Market'[ProductInfoField])))
Measure3 = Measure1 - Measure2 

Now, it pulls the correct values where the two ProductInfo match up, but given it's essentially a many to many relationship, the output is not what we want. In the above example, istead of the 3 rows that I want returned, it returns 9:

01-Hammer, 01-Hammer (correct info)

01-Hammer, 02-Screwdriver

01-Hammer, 03-Wrench

02-Screwdriver, 01-Hammer

02-Screwdriver, 02-Screwdriver (correct info)

02-Screwdriver, 03-Wrench

03-Wrench, 01-Hammer

03-Wrench, 02-Screwdriver

03-Wrench, 03-Wrench (correct info)

 

So, is there some way I can add a filter so only the matching values are returned? Basically an inner join through the visual's filter box? Thanks for reading!

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

 

Share the link from where i can download your PBI file.


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

Would help to see your visual definitions and relationships. But guessing in the dark it sounds like you populated the rows of your matrix with the product names from each of the source tables. Try using the product name from the product bridg. Table only. This with give you only 3 rows.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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