Skip to main content

Notifications

Announcements

No record found.

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

  • 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
    Nithya Gopinath 17,076 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
    ashlega 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
    Amine Amine 130 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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,432 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans