Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
I am working on this query that the return value should be a date but i keep getting this error (We cannot apply operator < to types Date and DateTime.) Does anyone have a suggestion on how i can resolve this error ? Here is my query
if((DateTime.From([ACT_START_DATE]) <>"" ) and (DateTime.From([ACT_END_DATE]) = "") or
(DateTime.From([START_DATE]) <= Date.AddDays(Date.From(DateTime.LocalNow()),2))) then (DateTime.From([FINISH_DATE]) >= Date.AddDays(Date.From(DateTime.LocalNow()),-1)) else null)
Solved! Go to Solution.
I tried that and getting this error now Token Then expected. here is how the changes look like.
if((Date.From[ACT_START_DATE]) <>"" ) and ((Date.From([ACT_END_DATE]) = "") or
(Date.From[START_DATE])<= Date.AddDays(Date.From(DateTime.LocalNow()),2))) then ((Date.From[FINISH_DATE]) >= Date.AddDays(Date.From(DateTime.LocalNow()),-1)) else null)
try Date.From instead of DateTime.From
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.