Looking for PowerObjects? Don’t worry, you’re in the right place! We’ve been part of HCL for several years, and we’ve now taken the final step in our acquisition journey: moving our website to the HCL domain. Nothing else is changing – we are still fanatically focused on Microsoft Business Applications!

HCLTech Microsoft Business Applications Practice Blog

for Dynamics 365, Power Platform and the rest of the Microsoft technology stack

Manipulating the Value of Days Remaining between Today and the Expiration Date in Calculated Fields

Post Author: HCLTech |

Calculated fields in Dynamics CRM are useful for calculating the number of days remaining between today's date and future dates, like expiration dates for example. Calculated fields work well on forms and show the latest value on a sub grid. However, there is a catch. If the expiration date has already past, the days remaining will be shown as a "–ve" value, which you do not want. In today's blog, we will show you how to manipulate the value of days remaining between today and the expiration date. Let's begin! 

Ideally, the number of days between dates should be a positive whole number or zero.    In order to achieve this, we utilize a solution using two calculated fields and described in the steps below:

1. First, you will need to create one calculated field and use the formula to calculate the exact remaining days between today and the expiration date as shown below. The field will now display the number of remaining days as calculated.

2. Create another calculated field and add a condition to check the other calculated field for the value. If the value is less than or equal to 0, then show the value of this field as 0. Otherwise, the field should show the value as is in the other field.

With these steps in place, the "–ve" value will never be displayed. That's all for the blog today folks. Get more tips and tricks like this one by subscribing to our blog!

Happy CRM'ing!

By Joe D365
Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.

PowerObjects Recommends