The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
User | Count |
---|---|
78 | |
74 | |
42 | |
32 | |
28 |
User | Count |
---|---|
104 | |
93 | |
52 | |
50 | |
46 |