Often it is a requirement that the active stage duration is tracked on a dashboard or the like. However, the duration field out of the box, at least in my experience, doesn’t do what you think it does. In fact, if you look at the default calculation what it is doing its actually trying to calculate the difference between the created on date, and the completed on date-which is calculating the total time from BPF start to BPF finish. What most people actually want to see is a measure of how long a record has been at a certain stage of a BPF. So that’s what will be discussed in this blog post; how to REALLY calculate duration.
Assuming you already have a BPF configured, go to the solutions list on your Dynamics 365 instance. You can get to it via the Settings cog>Advanced Settings>Settings dropdown (top nav bar)>Solutions
Choose your solution from the list and you should hopefully be presented with the old-school solution editor
Under the entities dropdown, locate your BPF. I’m using a modified Lead to Opportunity process as seen below:
Under the fields list, find the one called either Duration or bpf_Duration
Double click to open the field and you should see this:
Click edit to open the field’s calculation configurator
From here you’ll need to remove the existing calculation and enter the following:
DiffInMinutes(activestagestartedon, Now())
You can also use DiffInDays, Hours, Weeks, Months or Years depending on requirement.
You should have something similar to this:
Click Save and Close to close the window. You can now return to your solution editor and publish the changes.
The easiest way to test if this has worked is to open advanced find, use your process flow as the target and use the default active view as your saved view. Hopefully you should see some records appear with a populated duration field, something like this:
Hopefully you have found this tutorial helpful. if you require any more information, then get in touch via our contact us page.