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

Incorrect Errors in Appearing in Dataflows

Hi,

 

I have a set of dataflows which have been working and refreshing hourly for the past week. From 8pm BST yesterday (Sunday 13th June) all subsequent hourly refreshes have failed. No changes have been made to the dataflows, and I don't think any changes have been made to the originating database.

 

The error given is 'we cannot apply operator to types date and datetime', though it is noted against different entities in different dataflows depending on the specific refresh - I assume this is just due to sequencing/order of execution varying.


I have checked the specific steps noted in the errors, and they are all Date type compared with Date type. This code also worked correctly over the past ~7 days without giving the error. The error appears to be incorrect.

 

Has anyone experienced anything similar, or have any suggestions as to the cause and fix?

 

Thanks for your help

1 ACCEPTED SOLUTION

I have discovered a workaround that seems to have removed the error, which can hopefully help some people in the short term. I don't think this should be necessary though - this seems to be a more fundamental issue in Power BI service?

 

The workaround for me was to cast the (date type) field to a date type in the filter logic, for example:


From 

[Record Date] > DateTime.Date(DateTime.LocalNow())


to

DateTime.Date([Record Date]) > DateTime.Date(DateTime.LocalNow())


Just to reiterate that [Record Date] field is already of Date type..

View solution in original post

5 REPLIES 5
InsightBob
Frequent Visitor
mikesmith_bp
Frequent Visitor

I am getting the same error on a dataflow that has been running for a long time.  It began to fail early on Jun-14 and and failed everytime since.  The error message is 

We cannot apply operator < to types Date and DateTime. Operator = < Left = 4/1/2021 12:00:00 AM Right = 10/31/2020 12:00:00 AM

I have discovered a workaround that seems to have removed the error, which can hopefully help some people in the short term. I don't think this should be necessary though - this seems to be a more fundamental issue in Power BI service?

 

The workaround for me was to cast the (date type) field to a date type in the filter logic, for example:


From 

[Record Date] > DateTime.Date(DateTime.LocalNow())


to

DateTime.Date([Record Date]) > DateTime.Date(DateTime.LocalNow())


Just to reiterate that [Record Date] field is already of Date type..

View solution in original post

john_ach
Frequent Visitor

Thanks - I've rechecked and this is the flow structure:

  • Staging Dataflow - Loads table with DateTime column
  • Transformation 1 - Loads linked entity from the Staging Dataflow, converts column to Date type
  • Transformation 2 - Loads linked entity from Transformation 1 (column is Date type), performs > operation


So I would think that as I cast the column to Date type it should mean that even if the source data changed it should not impact my dataflows. 

 

An example of the error is below, in case useful
We cannot apply operator < to types Date and DateTime. Operator = < Left = 6/14/2021 12:00:00 AM Right = 12/16/2019 12:00:00 AM.

 

Also to note - when I view the dataflow the preview calculates correctly without any errors or warnings.

 

Thanks for your help

arvindsingh802
Super User
Super User

As these were refreshing fine before, just check if source data has been updated with bad data - Time window will be same when it start failing

Also validate if you are applying the data type change before applying the operator

 

If this post helps, then please consider Accept it as the solution and give it a thumbs up


If this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!
Proud to be a Super User!!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Kudoed Authors