Forum Discussion
markefrody
5 years agoPost Patron
Checking 2 Tables to Identify Identical Values
Hi Sir and Ma'am, I'm looking for a DAX to accomplish the following: I have 2 tables wherein there are identical values. I need to have table 1 to reflect which values are identical to table 2....
- 5 years ago
Here is one way. Create a measure as follows
Claimed = VAR Identical = COUNTROWS ( INTERSECT ( Table1, Table2 ) ) RETURN IF ( Identical = 1, "Yes", "No" )Now create a table visual from table1 and add the measure.
Edit: if the names of the columns are different, the you might need to use the following (which renames the columns to match them):
Claimed = VAR T1 = SELECTCOLUMNS ( Table1, "ID", Table1[ID], "Date Shipped", Table1[Date shipped] ) VAR T2 = SELECTCOLUMNS ( Table2, "ID", Table2[ID], "Date Shipped", Table2[Date shipped] ) VAR identical = COUNTROWS ( INTERSECT ( T1, T2 ) ) RETURN IF ( identical = 1, "Yes", "No" )
Anonymous
5 years agoNot applicable
Hi markefrody
Do you have duplicated Container numbers? Do you need to consider the date? Here is a simple one without considering duplicates or date, no relationship:
Cal Column = Not( ISBLANK(LOOKUPVALUE(Table2[Container #],Table2[Container #],Table1[Container #])))