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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Expression Error We cannot apply operator < to types DateTime and Date

Hi I keep the above error even after changing data type to Date for both columns. Trying to create a new custom column based on both columns date comparison.

 

Sodared123_0-1668562433379.png

 

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

Hi, @Anonymous 

I can reproduce the problem here.

veasonfmsft_0-1669024899623.png

 

As @amitchandak said, you need to make sure the two columns are of the same DateTime/ Date type before creating the custom column.

You need to insert the step after ‘Changed Type’ rather than ‘Added Custom’.

veasonfmsft_2-1669025158262.png

Please check my attached pbix for more details.

Best Regards,
Community Support Team _ Eason

View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

I can reproduce the problem here.

veasonfmsft_0-1669024899623.png

 

As @amitchandak said, you need to make sure the two columns are of the same DateTime/ Date type before creating the custom column.

You need to insert the step after ‘Changed Type’ rather than ‘Added Custom’.

veasonfmsft_2-1669025158262.png

Please check my attached pbix for more details.

Best Regards,
Community Support Team _ Eason

amitchandak
Super User
Super User

@Anonymous , Make sure dates are converted  before this new column creation


Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.