DAX Function Guide
DATESBETWEEN
Sam McKay
CEO & Founder
How does the DATESBETWEEN work?
DATESBETWEEN Formula Syntax
DATESBETWEEN(
<dates>,<start_date>,<end_date>
)
How do you use the DATESBETWEEN?
The DATESBETWEEN function is provided for working with custom date ranges.
Related Blog Posts
Loading
Considerations when using the DATESBETWEEN?
If start_date is a blank date value, then start_date will be the earliest value in the dates column.
If end_date is a blank date value, then end_date will be the latest value in the dates column.
The dates used as the start_date and end_date are inclusive: that is, if the sales occurred on September 1 and you use September 1 as the start date, sales on September 1 are counted.
If you are working with common date intervals such as months, quarters, and years, we recommend that you use the appropriate function, such as DATESINPERIOD.
Related Video Tutorials
Loading
Formula examples using the DATESBETWEEN
=CALCULATE(SUM(InternetSales_USD[SalesAmount_USD]), DATESBETWEEN(DateTime[DateKey], DATE(2007,6,1), DATE(2007,8,31) ))
= CALCULATE(SUM(FactSales[Net_Sales]), DATESBETWEEN(tbl_Calendar[Date_Id], DATE(2016,10,1), DATE(2016,12,31) ))
= CALCULATE ( SUM (Sales[Sales Amount]), DATESBETWEEN (Sales[Date], DATE (2015,1,1), DATE (2015,3,31))
Related Courses
Loading