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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
MT4U
Frequent Visitor

How to comapre 2 columns from 2 different tables with no relations and extract another column?

Table 1:

AB

A1

100
A2200
A3300

 

Table 2

A

A2

A5
A4

 

I need to compare table 1 and 2 (IMP: no relationship between them), then return column B for similar values of column A in both tables.

Can anyone help me?

2 ACCEPTED SOLUTIONS
johnt75
Super User
Super User

You could try

B =
CALCULATE ( MAX ( 'Table 1'[B] ), TREATAS ( { 'Table 2'[A] }, 'Table 1'[A] ) )

View solution in original post

You're adding it as a column in Table 2, not as a measure ? And you have the { } around the column reference ?

View solution in original post

3 REPLIES 3
johnt75
Super User
Super User

You could try

B =
CALCULATE ( MAX ( 'Table 1'[B] ), TREATAS ( { 'Table 2'[A] }, 'Table 1'[A] ) )
MT4U
Frequent Visitor

Thanks for the suggestion.

I tried this, but my column is not identifying inside 'Treatas'. I tried with 'Values' but no use. Column A in both tables are in TEXT format.

You're adding it as a column in Table 2, not as a measure ? And you have the { } around the column reference ?

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.

Top Solution Authors