cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

In DATEDIFF function the start date cannot be greatert than the end date

This is tipping me over the edge. I have an excel spreadsheet that I have imported into Power BI.

 

I have filtered the result so only 3 records appear.

The next review date are the 9th, 12th and 12th again of March 2018 and the exposure start daes are  1st April 2018.

 

My new colum is

Days Betwn = DATEDIFF(

(DATEVALUE(Sheet1[Next Review Date])),
(DATEVALUE(Sheet1[Exposure Start Date]))
,DAY)

and I am hit with the error In DATEDIFF function the start date cannot be greatert than the end date

 

Which is obviously not the case. I have edited the query so the value are dates only or date/time and I still get the same error.

Any help would be appreciated.

Do I need to create it as a measure opposed to a column?

Please help?

1 REPLY 1
Highlighted
Solution Sage
Solution Sage

Re: In DATEDIFF function the start date cannot be greatert than the end date

I'm confused as to what you're doing - you say you've converted the values to dates/datetime, but you're using the datevalue function as if you're importing text-based values? Generally I'll just make a difference column in M and take one column from the other as I find that to be the easiest way about it, but for your function maybe try getting rid of the datevalue bit of the function and just reference the existing columns directly?

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Power BI Desktop August 2020 Update

Power BI Desktop August 2020 Update

We have great updates this month! Click the link for the video with more info.

Top Solution Authors
Top Kudoed Authors