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
freelensia
Advocate II
Advocate II

Filter a date column by dates after a certain date coming from a variable

I have stored a certain PastThreshold  date from Excel named range like this. As you can see the final value is already formatted as date:

Pic1.png

Next, I want to filter a certain Date column from a table to be AFTER PastThreshold

Pic1.png

I get the "We cannot apply operator < to types DateTime and Date" error.
However both of the values are already formatted as date.

Can somebody help me?

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @freelensia 

Are you sure PastThreshold is stored as date and not DateTime? In the first pic you show, the icon seems to have a clock, which would indicate DateTime. The result shown at the top also shows the time  (2016/01/01 12:00:00) 

View solution in original post

2 REPLIES 2
AlB
Community Champion
Community Champion

Hi @freelensia 

Are you sure PastThreshold is stored as date and not DateTime? In the first pic you show, the icon seems to have a clock, which would indicate DateTime. The result shown at the top also shows the time  (2016/01/01 12:00:00) 

Thanks that was indeed the problem. I converted the variable using DateTime.Date(xxx) and that fixed the problem.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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