OpenBI Docs Buy

DATESBETWEEN

The dates from a start date to an end date, both included.

Group: Time intelligence. Compatible with DAX.

Syntax

DATESBETWEEN ( <dates>, <start_date>, <end_date> )
ParameterTypeDescription
datesDatesA column of dates of the model, such as Prices[Date].
start_dateDateThe first date to include. Blank: from the column's first date.
end_dateDateThe last date to include. Blank: to the column's last date.

Returns

Table. The column's dates from the start date to the end date, both included.

Remarks

  • It ignores the filter context on the column: the range is all it looks at, which makes it a filter that replaces the one on the dates. To keep the current filter as well, wrap it in KEEPFILTERS.
  • Only dates the column holds come back: on a column of business days, no weekends.
  • A start after the end gives an empty table.
  • It wants a column of the model, not a table expression.

Examples

A week and a bit of business days

EVALUATE
DATESBETWEEN ( Prices[Date], DATE ( 2026, 9, 25 ), DATE ( 2026, 10, 2 ) )
ORDER BY Prices[Date]
Prices[Date]
2026-09-25
2026-09-28
2026-09-29
2026-09-30
2026-10-01
2026-10-02

To the end of the data

A blank end runs to the column's last date.

EVALUATE
DATESBETWEEN ( Prices[Date], DATE ( 2026, 10, 12 ), BLANK () )
ORDER BY Prices[Date]
Prices[Date]
2026-10-12
2026-10-13
2026-10-14

Liters of a quarter

EVALUATE
ROW (
    "Second quarter of 2025",
        CALCULATE ( [Liters sold], DATESBETWEEN ( Sales[Month], DATE ( 2025, 4, 1 ), DATE ( 2025, 6, 30 ) ) )
)
Second quarter of 2025
153009

DATESINPERIOD, CALCULATE, FILTER, DATESYTD.

Last updated · OpenBI Studio 0.3.74