Shifted Horizons: PARALLELPERIOD vs DATEADD
Overview & Learning Objectives
Time Intelligence is the crown jewel of business analytics: comparing Year-to-Date (YTD) revenue, Month-over-Month (MoM) growth, and same-period-last-year trends. However, Time Intelligence functions (like `TOTALYTD` or `SAMEPERIODLASTYEAR`) are extremely fragile: if your Date table violates even a single prerequisite, calculations silently return wrong numbers or blanks.
- Memorize the 5 mandatory technical prerequisites for DAX Time Intelligence.
- Understand why missing weekend/holiday dates break continuous window algorithms.
- Verify that relationship cardinality and data types meet enterprise validation standards.
Industry Standard
Standard: Enterprise modeling governance at Amazon and Deloitte mandates that all Time Intelligence measures must reference a dedicated, continuous Date dimension explicitly marked as a Date Table.
Real-World Example: Scoop Master Seasonal Sales
Scoop Master evaluates ice cream sales growth. In 2024, February had 29 days (Leap Year). Without continuous dates, YoY fails.
| Rule # | Prerequisite Rule | Impact if Violated | Verification Status |
|---|---|---|---|
| Rule 1 | Must have a dedicated Date Table | Time Intelligence functions error out | Mandatory |
| Rule 2 | Date column must be contiguous (No gaps) | Period shift calculations fail or return BLANK | Mandatory |
| Rule 3 | Date values must be strictly unique | Relationship fails to establish as 1-to-Many | Mandatory |
| Rule 4 | Must be Marked as Date Table | Engine cannot optimize internal date shifts | Mandatory |
| Rule 5 | Data type must be Date (not Text) | Time Intelligence cannot parse date integers | Mandatory |
Syntax & Core Workflow
Verification: Dim_Date[Date] must contain continuous dates from min(Fact_Sales[Date]) to max(Fact_Sales[Date]) with zero gaps.
Parameters Breakdown
Contiguous Dates: Every calendar day (365 days a year, 366 in leap years) must be present in the Date table.Uniqueness: No duplicate date entries are permitted in the primary key column.Mark as Date Table: Tells the VertiPaq engine which column represents the continuous chronological timeline.
Sample Walkthrough (Q&A)
Question: What happens to `SAMEPERIODLASTYEAR()` if your store was closed on Sunday and that date is missing from your Date table?
Formula / Action: Missing dates violate the contiguous constraint.
Result: The function fails or returns distorted prior-year figures.
Explanation: Time Intelligence algorithms rely on shifting contiguous mathematical date intervals (e.g. subtract 365 days). If dates are missing, the interval mapping breaks.
Common Mistakes & Limitations
- Using the date column inside the Fact table directly in Time Intelligence functions instead of using the Dimension Date table.
- Leaving timestamps (`2026-03-15 14:32:00`) in the Date column instead of casting to clean pure Date (`2026-03-15`).
Keyboard Shortcuts
| Action | Windows | Mac |
|---|---|---|
| Mark as Date Table | Table Tools -> Mark as Date Table | Table Tools |
| Generate Date Table | Table Tools -> New Table -> CALENDAR(...) | New Table |
Pro Tips & Modern Alternatives
- Generate your continuous date dimension in Power Query using `#date(...)` lists or in your SQL data warehouse.
- Always disable Auto Date/Time in file options to avoid hidden table conflicts.