web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Calculate field depending on Current month

(0) ShareShare
ReportReport
Posted on by

Hi!

I would like to fill a field (through workflow or creating it as a calculated field) depending on if it is the current month or last month etc.

The new field should work as follows:

I have a value field (Revenue) and a closing Date. So if the closing date is current month it should show 100% of the Revenue

If the closing date was last month, it should show 50% of the Revenue

If the closing date was 2 months ago, it should show 25% of the Revenue

If the closing date was 3 months ago, it should show 20% of the Revenue...

and no, it should not look at the actual number of days from closing date, but the actual month.

So if today is 1st of May and the closing date was the 30th of April, it should show 50% of the revenue since April is last month

regards,

Tomas

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Calculate field depending on Current month

    Yes I figuired this out a while after posting and solved it like this. Thanks!

  • Verified answer
    Nithya Gopinath Profile Picture
    17,078 on at
    RE: Calculate field depending on Current month

    Hi Swede,

    As suggested by Alex, you could try creating two calculated fields.

    1.  A Whole Number data type calculated field for finding the difference in months between the closing date and today.

    4214.2.PNG

    2. A Currency data type calculated field for calculating the value of the new field based on the first calculated field.

    4214.2.PNG

    See the screenshots attached above.

    Here I have taken the created-on field as closing date and open revenue field as revenue.

    Hope this helps.

  • Verified answer
    ashlega Profile Picture
    34,477 on at
    RE: Calculate field depending on Current month

    Hi,

     you could do it with two calculated fields.

     Use the first one to calculate the number of months between "Now" and closing date. DIFFINMONTHS function is what you need - it'll give you the number of months between those two dates (when applied to April 30 and May 1, it will result in 1 month difference)

     Once you have that, you can use that first field to define conditions for the second calculated field (and, then, under each condition just use a formula to set the value -

    multiply Revenue by 0.5, 0.25, etc)

  • Suggested answer
    Amine Amine Profile Picture
    132 on at
    RE: Calculate field depending on Current month

    Hi,

    you can create a Custom Workflow Activity ,

    Or Try to use this :
    https://github.com/jlattimer/CRM-DateTime-Workflow-Utilities

    Regards,
    Amine

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#2
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans