Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
I have 2 tables (TableA and TableB) both have Name fields and TableB has a field called Status. Now, I want to compare both the tables on the Name field.
Condition 1: Compare only the Names that have the status = TRUE in TableB with the names in TableA.
Condition 2: After the comparison, return the output as "Matched" if both the tables have that name. If not, return "Not-Matched".
I tried something like this, but not able to put the filter to select only status = TRUE from TableB.
COLUMN = IF(
CONTAINS('TableB','TableB'[Name] ,'TableA'[Name])
, "Matched"
, "Not-Matched"
)
This is how my tables look like
| TableA |
| Name |
| Smith |
| Joe |
| John |
| Paul |
| Arjun |
| Rahul |
| Ajay |
| Rajesh |
| TableB | |
| Name | Status |
| Smith | TRUE |
| Joe | TRUE |
| John | FALSE |
| Paul | TRUE |
| Rahul | TRUE |
| Rajesh | TRUE |
| Ajay | FALSE |
| Arjun | FALSE |
Can someone please help, with the same?
Thanks in advance!
Solved! Go to Solution.
@Anonymous , Try a new column in Table B
new column = if(isblank(countx(filter(TableA, TableA[NAme] =TableB[Name]),TableA[Name])),"False","True")
@Anonymous
Your dax is check whether the table contains the names in other table. If that is the case, you can try create this column in TableB.
new column = IF([Name] in VALUES(TableA[Name])&&[Status]=TRUE(),"Matched","Not Matched")
If you want to compare names in each row, use this column:
new column = IF([Name]=RELATED(TableA[Name])&&[Status]=TRUE(),"Matched","Not Matched")
Both dax returns the same results with your sample table, but there is a difference if you applied it to real data.
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , Try a new column in Table B
new column = if(isblank(countx(filter(TableA, TableA[NAme] =TableB[Name]),TableA[Name])),"False","True")
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.