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
msedlak
Frequent Visitor

Comparing Values from one table to all values in a different table

Hello,

 

Here is a sample table I have built.  What I have is a two tables with addresses.  I need to compare addresses from table 1 to all the addresses in table 2.  There are no common columns to join tables on.  How do I get my data to appear like the picture below?

 

Thank you,

Mark

 

Table 1 Table 2 Combined
Coordinate 1 Coordinate A Coordinate 1 compared to Coordinate A
Coordinate 2 Coordinate B Coordinate 1 compared to Coordinate B
Coordinate 3 Coordinate C Coordinate 1 compared to Coordinate C
    Coordinate 2 compared to Coordinate A
    Coordinate 2 compared to Coordinate B
    Coordinate 2 compared to Coordinate C
    Coordinate 3 compared to Coordinate A
    Coordinate 3 compared to Coordinate B
    Coordinate 3 compared to Coordinate C
1 ACCEPTED SOLUTION
stretcharm
Memorable Member
Memorable Member

Try the Dax function CrossJoin

 

https://docs.microsoft.com/en-us/dax/crossjoin-function-dax

 

Add a Table using crossjoin

CrossJoin = (CROSSJOIN('Table 1','Table 2'))

You can they add a calculated column to check the values. This can be used to filter just the matches

Check = IF('CrossJoin'[Address1Data]='CrossJoin'[Address2Data], "Match", "No Match")

 

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

You can bring data from one table to another like the example given below

New column in Table 1 = maxx(filter(table2,table1[customer] = table2[customer] && table2[option]="ABC",table2[value])

New column in Table 1 = maxx(filter(table2,table1[Attribute] = table2[name] && table1[project] = table2[project]),table2[name])

 

You can refer to how I have taken date diff across two tables in 4 ways.

https://www.dropbox.com/s/y47ah38sr157l7t/Order_delivery_date_diff.pbix?dl=0

 

Can you share sample data and sample output? If possible please share a sample pbix file after removing sensitive information. Thanks.
Proud to be a Datanaut My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

stretcharm
Memorable Member
Memorable Member

Try the Dax function CrossJoin

 

https://docs.microsoft.com/en-us/dax/crossjoin-function-dax

 

Add a Table using crossjoin

CrossJoin = (CROSSJOIN('Table 1','Table 2'))

You can they add a calculated column to check the values. This can be used to filter just the matches

Check = IF('CrossJoin'[Address1Data]='CrossJoin'[Address2Data], "Match", "No Match")

 

 

Thank you for the quick reply.  This appears to be exactly what I am looking for.  I will give this a try when I get into the office tomrrow.  

 

 

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.