Hey everyone,
I'm working on a formula in Power Fx that subtracts the end date from today's date. I'm encountering some data type errors because the NOW() function includes both date and time, causing issues with calculations. Ideally, I'd like to use a function that only considers the date portion.
Any suggestions on how to tackle this? I'm looking for ways to calculate date only
Thanks in advance for your help!
That is also a very good thing to post initially - I will have to step away here as I do not use them.
Thanks for your reply,
In my case, I'm actually working within the model-driven app, not canvas app. in this model driven app, the Power Fx is in preview mode. Im thinking the TODAY() function might not be available in the preview mode yet so i am trying to find another solution.
Additionally, I can confirm that the End Date field in my model-driven app is set up as a date only type field, so it's not storing any time information.
try :
Abs(DateDiff(
'End Date',
Today()
))
Hi @viet561995 ,
Today() certainly is supported
I am assuming 'End Date' in your formula is actually a valid date field or value.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
Thanks for the suggestion! Unfortunately, I already tried using TODAY() in Power Fx, but it seems that function isn't supported. That's why I was using NOW() instead.
Hi @viet561995 ,
Try
DateDiff(
'End Date',
Today()
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
WarrenBelz
223
Most Valuable Professional
MS.Ragavendar
110
Michael E. Gernaey
89
Super User 2025 Season 1