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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Kudoed Authors