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
irnm8dn
Post Prodigy
Post Prodigy

Compare Values in Column Between Two Tables - Help with DAX Expression

I would like to write a DAX statement that compares the values of a column in Table A to a column in Table B.

 

Table A has unique values

Table B has duplicate values because the data represented is daily performance

 

Rough expression of the logic:

 

If the Transation ID in Column X of Table A matches a Transaction ID in Column Y of Table B, True else False.

 

Thanks! 

3 REPLIES 3
Anonymous
Not applicable

Hi @irnm8dn

 

Try this 

 

New column = IF ( TableX[TrnsactionID] = RELATED( TableY[TransactionID]), TRUE(),FALSE() )

 

Thanks
Raj

@Anonymous

 

I used this logic based on your recommendation:

 

Column = IF(Inv[UID]=RELATED(Sheet1[UID]),"Sold","Available")

 

The output in thge table view looks like this:

 

Capture.JPG

 

However, when I am in the Data View the column shows Available and Sold.  I can't figure out why I can't show "Available" on my table visualiizaiton.

 

Capture.JPG

Hi @irnm8dn,

Could you please share a sample data to have a test and post your desired result if possible?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.