DAX function
DATESBETWEEN — DAX function reference
An explicit date range.
Syntax
dax
DATESBETWEEN(<dates>, <start_date>, <end_date>)
Examples
dax
CALCULATE(SUM(Sales[Amount]), DATESBETWEEN('Date'[Date], DATE(2026,1,1), DATE(2026,3,31)))→ A number
dax
CALCULATE(SUM(Sales[Amount]), DATESBETWEEN('Date'[Date], DATE(2025,1,1), DATE(2025,12,31)))→ Calendar year 2025 total, hardcoded
dax
VAR CampaignStart = DATE(2026,3,1)
VAR CampaignEnd = DATE(2026,3,31)
RETURN CALCULATE(SUM(Sales[Amount]), DATESBETWEEN('Date'[Date], CampaignStart, CampaignEnd))→ Sales during a specific promotional window
Common mistakes & gotchas
- Start and end dates are fixed literals or expressions, not relative to the current filter context — unlike DATESINPERIOD, DATESBETWEEN doesn't automatically follow a slicer selection, so it's best for genuinely fixed ranges (a campaign, a fiscal cutover date), not rolling windows.
- If start_date is after end_date, DATESBETWEEN returns an empty table rather than an error, which silently produces a BLANK() measure.
Related DAX functions
From Time intelligence