Dimensional loading
Load dimensions before facts
A dimensional load assigns business attributes to dimensions and references their surrogate keys from facts at an explicit grain. FactSales is one accepted source LineId, not one order or product. DimProduct is one current row per product code (Type 1 attributes in this exercise). Unknown key -1 preserves valid sales whose product has not arrived. Build a full date dimension for a native Power BI model; the local fixture uses SaleDate for direct date filtering.
Design validation and replay rules
Keep a controlled staging record with LineId, date, product code, quantity and unit cents. Check required columns, date parsing, positive quantities, nonnegative prices and business-key uniqueness. Reject invalid lines; ignore identical replays and stop on conflicting duplicates. Negative quantities are intentionally outside this sales-only contract (real returns need a defined grain/policy). Load dimensions, check both natural and surrogate uniqueness, then resolve facts. Store integer cents and retain unresolved business keys in protected staging. Explicitly audit foreign-key matches; Warehouse does not enforce these constraints.
Worked example 1 — reconcile the initial fact load
Initial Product A maps to 101 (Hardware), B to 102 (Office), C to -1 (Unknown). L1=10,000, L2=6,000, L3=5,000, L4=3,000 cents. L2 replay adds nothing. L5 has invalid negative quantity; L6 has unparseable price. Seven raw = four accepted + one replay + two rejected. Use:
SELECT d.Category, SUM(f.RevenueCents) AS RevenueCentsFROM FactSales fJOIN DimProduct d ON d.ProductKey=f.ProductKeyGROUP BY d.CategoryORDER BY d.Category;Expected Hardware 15,000, Office 6,000, Unknown 3,000. A duplicate dimension key would multiply matched facts; a missing dimension without an unknown member could drop them. Compare grouped and ungrouped totals.
Worked example 2 — late dimension and safe replay
late-products.csv supplies C → 103, Office. Re-resolve L4 from its retained source product code; its LineId and 3,000 cents remain unchanged. Office becomes 9,000, Hardware remains 15,000, Unknown has no sales. Total stays 24,000 cents and four facts. Replaying source records must preserve the same facts; a conflicting L1 value blocks the candidate. Publish only after integrity, count and amount checks. Native Warehouse transaction implementation and concurrency are separate tests, not demonstrated by the local simulation.
Test the data contract before release
An optional nullable Channel addition may be compatible after downstream checks. Replacing UnitCents with text violates the numeric contract even when example strings look numeric. Confirm the actual engine data types, dimension and fact uniqueness, missing matches, date relationships, permission boundaries, and expected Power BI totals. The offline verifier uses SQLite primary keys as an extra local guard, not evidence of enforcement in Fabric. Keep the last approved gold version if any gate fails.
Practice and references
Complete the lab worksheet: map the source counts, category totals before/after C, replay/conflict policy, model relationships and schema-change gates. Compare dimension and fact load guidance: loading, dimension tables, fact tables, dimensional modeling. Next: Dataflows Gen1/Gen2, pipelines and orchestration.