Hi @Khusbu Kumari,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
Your refresh misses changes because folding breaks with the V1 connector and Import can’t see hard deletes. Move to Cosmos DB V2, keep early steps fold‑safe, enable Incremental Refresh on a time column, and handle deletes via soft delete or Change Feed. This removes the need to “recreate the query” and makes daily/Manual refresh reflect inserts and deletes reliably.
Query folding breaks early in Power Query (after certain transforms), so refresh reuses a stale snapshot and doesn’t re‑hit Cosmos properly.
Import models don’t naturally detect hard deletes in Cosmos; without tombstones or a foldable filter, removed rows remain until a full reload.
The Cosmos DB V1 connector has known quirks with folding and cross‑partition behavior; these are improved in V2.
What to do
- Switch to the Azure Cosmos DB (SQL API) V2 connector Reconnect with V2, point to the same database/collection, and keep early steps fold‑friendly (Source → Filter rows → Select columns → simple type changes).
- Preserve query folding In Power Query, right‑click the last step → “View Native Query.” If it’s disabled, move heavy transforms (merges, custom columns, row‑by‑row functions) after import or implement them as DAX measures. Split into:
- Staging query (folding to Cosmos)
- Transform query (non‑folding, post‑import)
- Configure Incremental Refresh (so inserts/updates flow without full reloads)
- Add
RangeStartandRangeEndparameters. - Filter the query on a reliable time field that folds (Cosmos
_tsor yourupdatedAt). - Set table Incremental Refresh policy (e.g., store 3 years, refresh last 7 days).
- Add
- Handle deletes explicitly
- Soft delete pattern: add
isDeleted(or status) to documents; filterisDeleted = falsein the foldable portion of the query. - Hard delete pattern: use Cosmos Change Feed to capture deletes (tombstones) into a staging store (Azure Storage/Azure SQL) and build the model from there; schedule that pipeline + dataset refresh. For occasional cleanups, trigger a Full Refresh in the Service.
- Soft delete pattern: add
- Refresh hygiene
- Desktop: File → Options → Data Load → Clear cache, then Refresh.
- Queries: ensure Include in report refresh is enabled for each query.
- Service: Cosmos is cloud; avoid binding the dataset to a misconfigured gateway. Check Refresh history for failures.