
Microsoft Fabric
Check duplicate business keys and missing parent Accounts in Microsoft Fabric Warehouse before publishing a staged batch.
- Stage the batch
- Keep the source key and file batch ID.
- Validate
- Find the repeated Account key and the invoice with no parent.
- Publish
- Compare record counts and totals after the approved corrections.
A Fabric warehouse receives a monthly account export. The file includes a duplicate account and an invoice whose parent account is missing. Stage the source file and run checks before promoting it to the reporting tables.
Validate the source in a warehouse staging table
In a test Fabric Warehouse, load the inbound rows into a staging table and keep the batch ID and source business key. Separate the stage from the tables used by reporting. Fabric Warehouse supports primary and unique constraints as nonclustered and NOT ENFORCED, and supports foreign keys as NOT ENFORCED. Add explicit checks that group by the business key and compare invoice Account IDs with the approved Account table before publishing.
In the example, a 200-row account file contains one repeated account key. Of 120 invoice rows, one points to a missing Account. Keep both exceptions visible with the batch and source row. Correct the stage or hold the batch under the agreed publication policy.
Verify both the load count and the reporting grain
| Check | Expected result | Evidence |
|---|---|---|
| Count staged account rows and keys. | 200 rows and 199 distinct account keys. | The duplicate report identifies the repeated key before publishing. |
| Join staged invoices to approved Accounts. | One missing parent is visible and can be repaired. | The failed invoice ID, missing parent key and owner. |
| Publish a corrected batch in the test workspace. | The report shows the approved Accounts and invoices without inflated totals. | Compare stored record counts and invoice totals with the approved input. |
Repeat the same batch in the test workspace to confirm your load policy recognizes it. The data quality guide shows how to distinguish flagged records from confirmed duplicates when reporting the results.