Rolling windows and partial dates
A rolling window is not a month label
A rolling total follows an anchor date instead of resetting at the first day of the calendar month. Period completeness is separate from the last transaction date: a day with no sale may be fully loaded. Use the isolated Import model in labs/date-time-intelligence/README.md. It has a single active one-to-many relationship from Dates[Date] to Sales[SaleDate], single-direction filtering, no RLS, en-US formula separators, USD whole-dollar amounts and a certified synthetic data cutoff of February 15, 2025. Native Desktop/DAX results are predicted, not executed. Each named measure is created separately. Do not use the auto date hierarchy. Use the fixed certified cutoff from the fixture, not TODAY or MAX of transaction date as a universal freshness guarantee.
Example 1 — Trailing one calendar month
Rolling One Month =VAR Anchor = MAX(Dates[Date])RETURN CALCULATE([Revenue], DATESINPERIOD(Dates[Date], Anchor, -1, MONTH))Select February 15, 2025. For this mid-month anchor the dates run January 16 through February 15 inclusive; January 15 is excluded. Revenue is 200 (80 + 90 + 30). A trailing 30-day window is a different business definition. Date coverage can truncate the returned window; validate coverage before labeling it complete. The simple measure is intended for a date selection ending at or before the certified cutoff.
Example 2 — Guard the partial period
Complete Selection Growth =VAR Cutoff = DATE(2025, 2, 15)VAR Prior = [Prior Year Revenue]RETURN IF(MAX(Dates[Date]) > Cutoff || ISBLANK([Revenue]) || ISBLANK(Prior), BLANK(), DIVIDE([Revenue] - Prior, Prior))For February 1–15 this returns 50%. For all February 2025 it returns BLANK: 120 is known only through the 15th. An unguarded comparison against full February 2024 (110) would suggest roughly 9.09% growth, mixing a partial period with a full period. This guard assumes verified continuous coverage of both periods before the cutoff and a nonempty contiguous selection; real models need source-specific coverage metadata and a documented no-sales policy. A future-only date range must not be presented as a completed zero-sales period.
Avoid accidental changes of anchor
On an unfiltered card MAX(Dates[Date]) is the final calendar date (2026-12-31), not the last available business date. Choose a date filter or an explicit anchor policy. A rolling window at the first available date is incomplete even if a sum can be computed. If data arrives late, the latest transaction date is not a reliable completeness marker. Show the cutoff and the comparison definition in the report.
Practice — Change the anchor
Use January 31, 2025 as the anchor. Compute the trailing one-month amount using December 31 excluded and January 1–31 included. Then select all March 2025: explain why a guarded growth measure is unavailable even though the date table contains March.
Further official reading
Microsoft Learn: datesinperiod function dax
These links provide supporting context; the local fixture and its expected results remain unchanged.