Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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
Solved! Go to 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..
Whenever you find weird errors appear all of the suddent to previously working dataflows, especially regarding data type conversions etc. it's this problem 9 times out of 10:
For whatever reason, Microsoft resets privacy levels on your dataflow's data sources. If you see unexplainable errors, go to Settings and make sure that all the data sources have the same (!) privacy level. After you've done, the dataflow should refresh with no problem.
Don't ask me why it's happening. Things work in misterious way in the cloud.
https://community.powerbi.com/t5/Issues/Dataflow-refresh-error-Date-Datetime/idc-p/1902808#M67280
A few having this problem
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..
Thanks - I've rechecked and this is the flow structure:
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
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
User | Count |
---|---|
45 | |
25 | |
21 | |
18 | |
18 |
User | Count |
---|---|
51 | |
45 | |
24 | |
24 | |
21 |