Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
timazarj
Helper II
Helper II

DATESBETWEEN function Error

Hello,

 

I need to find the sales to quote ratio for the current month, sales are calculated based on ActionAttemp date column in a table and quotes are calculated based on Createdtime date column in the same table.

for finding the sales based on ActionAttempt date I wrote the following:

SalesActionDate =
CALCULATE(
    SUM('Leads'[SOLD]),
    (DATESBETWEEN('Leads'[lastAction_timestamp],
        {DATE(2021, 3, 1) + TIME(00, 01, 01) },{DATE(2021, 3, 31) + TIME(12, 01, 01)})
))
 
And I got this error for calculation, any suggestion?
timazarj_0-1618594928835.png

 

1 ACCEPTED SOLUTION
v-cazheng-msft
Community Support
Community Support

Hi @timazarj 

You can make some changes to your Measure as the following if you don't want to create a Calendar table.

 

SalesActionDate =

CALCULATE (

    SUM ( 'Leads'[SOLD] ),

    FILTER (

        'Leads'[lastAction_timestamp],

        'Leads'[lastAction_timestamp]

            >= ( DATE ( 2021, 3, 1 ) + TIME ( 00, 01, 01 ) )

            && 'Leads'[lastAction_timestamp]

                <= ( DATE ( 2021, 3, 31 ) + TIME ( 12, 01, 01 ) )

    )

)

 

Here is a sample.

v-cazheng-msft_0-1618799357146.png

 

Best Regards

Caiyun Zheng

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

3 REPLIES 3
timazarj
Helper II
Helper II

Thank you all for the help!

v-cazheng-msft
Community Support
Community Support

Hi @timazarj 

You can make some changes to your Measure as the following if you don't want to create a Calendar table.

 

SalesActionDate =

CALCULATE (

    SUM ( 'Leads'[SOLD] ),

    FILTER (

        'Leads'[lastAction_timestamp],

        'Leads'[lastAction_timestamp]

            >= ( DATE ( 2021, 3, 1 ) + TIME ( 00, 01, 01 ) )

            && 'Leads'[lastAction_timestamp]

                <= ( DATE ( 2021, 3, 31 ) + TIME ( 12, 01, 01 ) )

    )

)

 

Here is a sample.

v-cazheng-msft_0-1618799357146.png

 

Best Regards

Caiyun Zheng

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

aj1973
Community Champion
Community Champion

Hi @timazarj 

DATESBETWEEN  is a Time intelligence function therefore you need a Calendar Table in your model. Your actual Leads Table contains duplicate dates, Can't be for the use of DATESBETWEEN.

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.