Downloads
DAXTime intelligence: shift and compareIntermediate

DATESBETWEEN

Returns the dates from the start date to the end date, including both ends.

Syntax
DATESBETWEEN(<dates>, <start_date>, <end_date>)

Returns: A table of dates.

What it does

DATESBETWEEN returns a fixed range of dates. CALCULATE uses it as a filter, so a measure covers exactly that range, whatever the report's date slicer shows. Finance teams use it for an audit period, a covenant test period, a fiscal quarter with fixed boundaries, or a custom date range chosen by a user from a parameter table.

Syntax and arguments

Example

An auditor asks for revenue for the nine months from January 1 to September 30, 2026. The measure fixes the period, whatever the report slicer shows.

Revenue Audit Period =
CALCULATE(
    [Total Revenue],
    DATESBETWEEN('Calendar'[Date], DATE(2026, 1, 1), DATE(2026, 9, 30))
)

Both ends count, so September 30 is included. The result is the same no matter which month is in the report's row.

Example: a second, different use

A range chosen by the user in a parameter table with a start and an end. The measure reads the two dates and applies them to the Calendar.

Revenue in Selected Range =
VAR StartDate = MIN('Report_Range'[StartDate])
VAR EndDate = MAX('Report_Range'[EndDate])
RETURN
CALCULATE(
    [Total Revenue],
    DATESBETWEEN('Calendar'[Date], StartDate, EndDate)
)

Things to watch

In business terms

DATESBETWEEN is used for audit periods, covenant test periods, custom quarters, trailing windows with fixed boundaries, and any period a lender or an auditor defines in writing. Fixed boundaries make the number reproducible when the report is run again.

Related functions

All DAX functions · View as Markdown · DAX fundamentals