Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello guys,
What would be the DAX measure in Direct Query looks like if I have two tables which I want to count records with some value not in other table.
So I have something like this :
I want to count number of Sales in TableA, but if the SalesID is not in TableB [RecallSalesId]
And this tables is not relate each other in matter of Relationship diagram, since it is 2 fact tables.
Thanks
Solved! Go to Solution.
calculate(countrows(Table1), filter(Table1, not(Table1, Table1[SalesID] in values(Table2[SalesID]))))
Try like, but this can really costly in the direct query or might not work
calculate(countrows(Table1), filter(Table1, not(Table1, Table1[SalesID] in values(Table2[SalesID]))))
Try like, but this can really costly in the direct query or might not work
Hmm.. yah.. I can see it's costly since it is distinct all TableB with VALUES.
But I think it is no choice.
It works.
Thanks,
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!