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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
cubedweller
Regular Visitor

power query formula error: cannot apply operator <

The power query formula shown below is given me the error shown below.

A sample of the data where Completed Paste Due ❤️ Days is displaying "error" is shown below as well.

Task Due Date and Task Finished Date are both of type date.

Any idea how to fix this error?

 

if [Completed Past Due]=1 and ([Task Finished Date]-[Task Due Date])>=0 and ([Task Finished Date]-[Task Due Date])<3 then 1 else 0

 

Power Query ErrorPower Query Error

 

 

DataData

 

Thank you.

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

This should work

 

  1. Change the data type of task finished date and task due date columns to Whole Numbers
  2. Write your formula
  3. Change the data type of task finished date and task due date columns to Date

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

 

This should work

 

  1. Change the data type of task finished date and task due date columns to Whole Numbers
  2. Write your formula
  3. Change the data type of task finished date and task due date columns to Date

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.