Forum Discussion
arb1782
5 years agoHelper III
Help with calculation - count IDs except IDs in another table
Hi I have data like this and I want to count the number of IDs in table 1 minus those that are mentioned at least once in table 2. Could anyone help me with the right DAX? With the example data b...
Anonymous
5 years agoNot applicable
Try this,
Measure = COUNTROWS(Table1) - DISTINCTCOUNT(Table2[ID])
arb1782
5 years agoHelper III
HI Anonymous AlB Yggdrasill
Thanks for the suggestions so far.
I realise I should have been a bit clearer about what I am looking to do - apologies. I need to subtract the unique IDs that appear in table 2 if they appear in a subset from table 1.
So with the example data below, I'd be looking for the answer of 1 (3 from table 1 minus 2 from table 2)
Table 1
| ID | Category | |
| 001 | A | |
| 002 | A | |
| 003 | B | |
| 004 | A | |
| 005 | C |
Table 2
| ID |
| 001 |
| 001 |
| 003 |
| 004 |
| 005 |