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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
MT4U
Regular 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] ) )

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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