The DATESBETWEEN function returns a table containing a single column of dates that begins and ends with the dates included as parameters.
DATESBETWEEN(
dates,
start_date,
end_date
)
- dates: Reference to a column that contains dates.
- start_date: Starting date to consider.
- end_date: End date to consider.
The DATESBETWEEN function returns a table containing a single column.
The dates returned in the function result include the start and end dates.
We define the following measure by which we calculate sales between January 2, 2007 and January 4, 2007:
Ventas período = CALCULATE(
[Ventas],
DATESBETWEEN(
FactSales[DateKey],
DATE(2007,1,2),
DATE(2007,1,4)
)
)
If we show a table with sales per day and a second "card" type display with the newly calculated Ventas período measure:
...we can check how only the sales in the corresponding period are added.