Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Suggested answer

How to create a field that can count the consecutive years amount>0

Posted on by 4
Hi,
 
I'm trying to create a field or a process that will show the consecutive number of years a contact has had an amount > 0. So it would count from present year backwards to the year an amount is 0. 
i.e) Has an amount > 0 from 2024 to 2020 but then has amount > 0 again in 2018, so the field would show 4. 
 
Thank you 
  • How to create a field that can count the consecutive years amount>0
    Hi, 
     
    First thank you for your response. What I'm trying to do is create a workflow that will count the number of consecutive years a contact has a amount more than zero. For example, this contact has had consecutive gifts for 2021, 2020, 2019, and then a gap year from 2018-2014. So the consecutive year count would be 3. I have created a field that shows the last amount recieved date, but not sure how to create a work flow to pick up the date on which the first gap year appears. Any suggestions would be helpful. 
     
     
    Thank you 
  • Suggested answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    How to create a field that can count the consecutive years amount>0
    Hi Partner,
    The key point is to compare the value of the amount in each year.
    Based on your description, are you trying to go backward from the current year? Do you have multiple fields storing the amount values for those years?
    If so, you can use power automate to create a flow that will find all the years that have an amount value less than 0, and then find the closest to this year among them, and then you can come up with the number of consecutive years.

    I hope you can mark my answer verified if it is helpful! If you have any questions, please feel free to contact me.
    Regards,
    Leah
     

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,552 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,552 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans