Forum Discussion

Juuls's avatar
Juuls
Frequent Visitor
5 years ago
Solved

Check if column value between 2 tables is equal

Hi all,   Currenlty I am trying to compare values from two columns between two tables. The situation and desired outcome is as follows: Table A: Country Currency United Arab Emirates Uni...
  • v-kelly-msft's avatar
    v-kelly-msft
    5 years ago

    Hi  Juuls ,

     

    If you are creating a measure,remember to add "Max" when you wanna query a certain field.

    Modify your measure as below:

    Measure = 
    IF(ISBLANK(COUNTX(FILTER(ALL('Table A'),'Table A'[Country]=MAX('Table B'[Country])&&'Table A'[Currency]=MAX('Table B'[Currnecy])),'Table A'[Country])),"Coprorate Bond" ,"Government Bond")

    And you will see:

    If you need a calculated column,using below dax expression:

    Column = IF('Table A'[Country]&'Table A'[Currency]=RELATED('Table B'[Country])&RELATED('Table B'[Currnecy]),"Government Bond","Coprorate Bond")

    And you will see:

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!