• Skip to main content
  • Skip to footer

Curbal

Learn how to grow your business with your data and Power BI

  • Resources
    • DAX Glossary
    • Download Center
    • Template Apps
    • Data Stories Gallery
    • Solution Gallery
    • Learning Resources
  • Courses
    • Introduction to Power BI – FREE Online course
    • Power Query Online Training for Power BI
    • M Language Online Course: The unofficial and Practical Reference Guide
  • Blog
  • Shop
    • Courses
    • Swag
    • Template Apps
    • Donations
  • Cart
  • Register/ Log In
    • Become a Member
    • Log In
    • My account
    • My Courses
  • Contact
You are here: Home / CM Tooltip Glossary Pro+ / DATESBETWEEN

DATESBETWEEN

posted on May 4, 2018

« Back to Glossary Index

Syntax

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

Tutorial with example

In todays video we are going to cover the DAX function DATESBETWEEN.

DATESBETWEEN function allows you to calculate amounts between two dates you specify.

For example, if you want to calculate the sum of sales between two specific dates, this is the perfect function for you.

You can “hardcode” the dates or you can specify the dates dynamically, both options are possible.

DATESBETWEEN DAX function will give the same results as DATESINPERIOD DAX function when you are rolling dates backwards, but the main difference is that DATESBETWEEN allows you to specify a start and end date while DATESINPERIOD allows you to specify an end date and then an interval to roll it backwards.

Download example file:

Download Power BI file: here.

Remarks

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.

Note

The DATESBETWEEN function is provided for working with custom date ranges. 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.

This DAX function is not supported for use in DirectQuery mode.

Was this helpful?
[Total: 7   Average: 3.1/5]
Related Articles:
  • The ultimate dashboard to track your website growth with Google Analytics and Power BI (supercharged Excel)
« Back to Index

Reader Interactions

Comments

  1. markus

    May 21, 2018 at 9:06 am

    Hello, I have some problem, I am searching for a option. My goal is to Count Days between Sales Date and arrive Date, but my problem is, that weekends and public vacation should not be count. Perhaps you can help me. Thanks for your support.

    Reply
    • Ruth Pozuelo Martinez

      May 21, 2018 at 4:23 pm

      Hi Markus,
      I have a few videos that my help you:
      https://www.youtube.com/watch?v=GLIoDbOiJgw
      https://www.youtube.com/watch?v=9M1V_m-oEzc&vl=en
      /Ruth

      Reply

Let us know your thoughts... Cancel reply

Footer CTA

Join our community of +20,000 professionals

Become a Member

Subscribe to YouTube

About us

Curbal AB
Kopparbergsvägen, 10
722 13 – Västerås
Sweden

OrgNo: 5569680852 | VAT: SE556968085201

 

Location:

© Copyright 2014-2021 · Curbal AB · All Rights Reserved · Privacy Policy · Terms of Service · Refund Policy · Log In