Forum Discussion
Calculate 3 Dates in a SharePoint List
I am trying to calculate the number of days between three items.
I have a Purchase Date, a Renewal Date and Todays date. The formula looks like this?
=IF(OR(PurchaseDate="",RenewalDate=""),"0",(RenewalDate-PurchaseDate)-TODAY())
The IF OR statement is if there is no Renewal Date, then put 0.
So what I am trying to get is a running number in the DaysToRenewal so that I can create a flow that will notify me when to renew a item.
So for an example if I bought the item today, and renewal was a year from now, the DaysToRenewal would be 365. But tomorrow and going forwared, I want that number to decrease based on the Today element.
Right now, the Field show -45.552 days.
If I put a ,"D" after TODAY, I get an "Something went wrong" message and taken back to the home page.
Thanks
1 Reply
- Rob_ElliottBronze Contributor
bfry2461 What you want isn't possible with a calculated column because the value is actually static and doesn't update dynamically each day. It's only updated when the item is edited. To dynamically update your DaysToRenewal column you need to use JSON column formatting.
But in your scenario you can do this in Power Automate without the need for the days to renewal and just have the email sent to you 3 days before the renewal date. To save me having to do screenshots there is a good video from Reza Dorrani which shows you how to do it at https://www.youtube.com/watch?v=v54QozIEGyw
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, Power Platform, WSP Global (and classic 1967 Morris Traveller driver)