Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous

     

    Try this 

     

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

     

    Thanks
    Raj

    • Anonymous's avatar
      Anonymous
      Not applicable

      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:

       

       

      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.

       

      • v-danhe-msft's avatar
        v-danhe-msft
        Microsoft Employee

        Hi Anonymous,

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

         

        Regards,

        Daniel He