DAX code
Orphan Records Count =
VAR FactKeys = VALUES('Sales'[ProductID])
VAR DimensionKeys = VALUES('Product'[ProductID])
RETURN
COUNTROWS(EXCEPT(FactKeys, DimensionKeys))
Counts fact rows whose key doesn't exist in the related dimension table, indicating a broken relationship.
Type your table and column names once. Every measure below updates.
Orphan Records Count =
VAR FactKeys = VALUES('Sales'[ProductID])
VAR DimensionKeys = VALUES('Product'[ProductID])
RETURN
COUNTROWS(EXCEPT(FactKeys, DimensionKeys))
A non-zero result usually means the dimension table is missing rows, or the fact table has bad/unmapped keys.
Browse all 175 measures in the Power BI DAX Measures Library, or search the library for something similar to Orphan Records Count.