web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Suggested answer
    Amine Amine Profile Picture
    132 on at

    Hi,

    you can create a Custom Workflow Activity ,

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

    Regards,
    Amine

  • Verified answer
    ashlega Profile Picture
    34,477 on at

    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)

  • Verified answer
    Nithya Gopinath Profile Picture
    17,078 on at

    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.

  • Community Member Profile Picture
    on at

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

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans