Late arrivals and idempotency
Incremental loading is a stateful design
A full load recomputes from the complete authoritative source. Incremental ETL processes new or changed source records since a durable checkpoint, often called a watermark. CDC (change data capture) can expose inserts, updates and deletes with source-specific ordering and retention. A timestamp or increasing ID watermark is simpler but does not automatically capture deletes, late commits or equal timestamps. Pick a stable ordering and handle ties, retention and failure recovery. Idempotency means replaying the same input produces the same intended stored state, not necessarily identical logs or execution time. Power Query transformation steps alone do not maintain an external durable watermark or implement transactional upserts.
Example 1: arrival time versus event time
The first delivery ends at ArrivalSeq 105. The next contains 106 (E5, Jan 1 event, 10 USD), 107 (E2 with changed amount 35), and 108 (E7, 0 USD). E5 arrived late: its event time precedes some already processed records. A filter based only on the latest event timestamp would miss it. Use a source arrival sequence in this controlled fixture, with previous < ArrivalSeq <= capturedUpper, then checkpoint 108 only after the outcomes are durably committed. Under the immutable-event rule the second batch accepts E5 and E7, rejects conflicting E2, and contributes 10 USD. The cumulative accepted state is four unique events totaling 60 USD. Reprocessing the same deliveries must not add another 60 USD. The supplied Python oracle simulates durable state in memory, not production transaction behavior.
Example 2: separate ETL from model partitions
Semantic model incremental refresh is a Power BI policy for partitioning and refreshing model data. It is not a source CDC pipeline. In an approved model, create the reserved case-sensitive Date/Time parameters RangeStart and RangeEnd and apply a half-open filter to a Date/Time column. Illustrative static fragment, where Events is an existing typed query:
Table.SelectRows(Events, each [EventDateTime] >= RangeStart and [EventDateTime] < RangeEnd)For adjacent windows Jan 1 to Jan 2 and Jan 2 to Jan 3, an event exactly at Jan 2 midnight belongs only to the second. Do not use inclusive comparisons on both boundaries. Use matching types and a consistent UTC interpretation. A source filter that folds can reduce retrieval; verify actual folding and refresh. Configure the policy separately in Desktop and verify it in an authorized Service workspace. This fragment is not a CDC checkpoint or proof of configured partitions. Late historical events outside the refresh window need an explicit correction/backfill policy.
Failure and retry design
Capture the upper sequence from a consistent source boundary; process only that bounded range. Validate and stage the accepted, replay and rejected results. Commit the fact mutations, audit identities and checkpoint together where feasible, or design a recoverable protocol if stores cannot share a transaction. If processing crashes before commit, retry the same range. If commit succeeded but acknowledgment was lost, stable delivery keys and business keys prevent double application. Reject conflicting immutable events for review; mutable entities need a different rule, such as ordered versioned upsert and tombstones. Track checkpoint lag, reject rate and late arrivals. A sequence gap or CDC retention breach requires recovery from an authoritative snapshot, not a blind checkpoint jump.
Practice: plan a restart
Assume the second batch fails immediately before committing. What watermark should remain? What happens on retry? Then assume commit succeeded but the caller lost its acknowledgment. Specify two assertions that would demonstrate stable business state after reprocessing. Explain why a 7-day semantic refresh policy cannot guarantee capture of a 30-day-late event.