Forum Discussion
Check if column value between 2 tables is equal
- 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,
KellyDid I answer your question? Mark my post as a solution!
First of all, thanks for the reply!
Whenever I am trying to refer to the second table, the DAX shows me the table/column cannot be found. I have added a screenshot from the statement that I wrote down and the notifications I receive. Additionally I have added a screenshot from the relational model, which automatically shows a many to many relationship. Might this be the/an issue?
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!