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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Compare two diffrent tables

Hello Power Bi Community,

I need to create a new column in table A to compare two serial numbers from two different tables (one is in table A and the other in table B), if the serial number matches I need to insert in the new column in table A a value from table B which is in the same row as the serial number. For example:

Tabel A:

Serialnumber

New created column

1

12,3

2

11,4

3

 

4

13

5

 

 

Tabel B:

Serialnumber

Value form tabel B

1

12,3

2

11,4

4

13

 

Thanks for your help

 

Greeting Lukas

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , Try a new column like

if( Table1[value] = maxx(filter(Table2, Table2[Serialnumber] = table1[Serialnumber]),Table2[Value]),1,0)

Anonymous
Not applicable

I tryed this:

 

New column = if(LOOKUPVALUE(Table2[SN],Table2[SN],Table1[SN]),1,0)

 

With this function I have a 1 in every line where the serial numbers are the same. Now I just have to somehow replace the 1 with the value in table 2.😅

Greg_Deckler
Super User
Super User

@Anonymous Maybe:
Column = LOOKUPVALUE('TableB'[Value],'TableB'[Serialnumber],'TableA'[SerialNumber])


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Din't work. The error message is: A table with several values was returned although a single value was expected.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

Top Solution Authors