Join 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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I'm having an issue when trying to create a custom column that needs to compare an action date with todays date. The cause of the issue has been narrowed down to the below, and I'm not sure why what I've pasted doesn't work?
if [Action Date] < DateTime.LocalNow() then "something" else "other"
Solved! Go to Solution.
Hi @mterry,
I guess the data type of [Action Date] is date, while DateTime.LocalNow() returns datetime, which leads to unmatched error.
Please modify your code as below:
=if [Date] < DateTime.Date(DateTime.LocalNow()) then "something" else "other"
Best regards,
Yuliana Gu
Hi @mterry,
I guess the data type of [Action Date] is date, while DateTime.LocalNow() returns datetime, which leads to unmatched error.
Please modify your code as below:
=if [Date] < DateTime.Date(DateTime.LocalNow()) then "something" else "other"
Best regards,
Yuliana Gu
That worked, thank you
Hi,
Your formula works fine for me.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!