Customer Age Calculation Using Microsoft Dynamics 365 Calculated Fields

Calculated field:

-Contains calculations that use fields from the current entity or related parent entities.

Single Line of Text, Option Set, Two Options, Whole Number, Decimal Number, Currency, Date and Time

Now() Function:

To complement the Date Difference calculations in the Spring Release, there’s another function in Calculated Fields called “Now()”, which populates the current date/time value in a field or a formula. The Now() function is a little selective in how it interacts with another new concept also rolling out in the Spring Release: Behavior of date fields whose choices are User Local, Date Only, and Time-Zone Independent.

For our purposes, we’ll only delve into date field Behavior in asmuch as it interacts with the Now() function. Here are some things to keep in mind:

  • As of publication time, you can only use Now() directly in a Date Difference formula if the Behavior of the date field is set to “User Local”

age1

A Date Difference formula comparing a date field with User Local Behavior and Now() might look like this:

age2

  • You can’t directly use Now() in a formula where the other date field has a Behavior of Date Only, but if you create a new date field, set its Field Type to Calculated and its Behavior to Date Only…age3

…you can use the Now() function on its own to populate the field…

age4

…and then use that field in a calculation.

age5

  • So far, the Now() function doesn’t work at all—either in a Date Difference formula or used on its own to populate a field—with date fields whose Behavior is Time-Zone Independent.

4 thoughts on “Customer Age Calculation Using Microsoft Dynamics 365 Calculated Fields

  1. It does work. Make sure you set the data type AND behavior to Date Only for the current date field. In power apps behavior is under advanced options.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s