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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to reset the seque...
Power Apps
Answered

How to reset the sequence number to 1 when new month starts?

(1) ShareShare
ReportReport
Posted on by

I have been using formula that create a new 'Tracker ID' based on the following criteria:

  • If the current item already has a 'Tracker ID' value, that value is used.
  • If not, it generates a new 'Tracker ID' by combining the current month and year with a count of valid records in the 'Issue Tracker', incremented by 1.

If(ThisItem.'Tracker ID'<>Blank(),ThisItem.'Tracker ID',Month(Now())&"/"&Year(Now())&"/"&Sum(CountIf('Issue Tracker',ThisItem.ID<>0),1))

 

Now, I want to reset the sequence number to 1 when new months starts. Please guide.

Categories:
I have the same question (0)
  • Verified answer
    poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    I am not sure what data source you are using, but if you are using a SharePoint List, you can take advantage of using the out of the box fields to know when your issue was first created, by using the out of the box SharePoint Created field in particular.

    This can really help to know what sequence number to assign.

     

    In order to know what sequence number to assign, you should get a count of the current number of issues you have between the first day of the current month, and the first day of the next month not inclusive of that day. To do so, you can try a formula like the below, you can just use it wherever you used the original formula and replace your original formula with the following instead:

     

    If(
     ThisItem.'Tracker ID' <> Blank(),
     ThisItem.'Tracker ID',
     With(
     {wFirstDayOfMonth: Date(Year(Today()), Month(Today()), 1)},
     Month(Now()) & "/" & Year(Now()) & "/" & 
     CountRows(
     Filter(
     'Issue Tracker', 
     Created >= wFirstDayOfMonth &&
     Created < DateAdd(wFirstDayOfMonth, 1, TimeUnit.Months)
     )
     ) + 1
     )
    )
    

     

    See if it helps @sanjeevkumar1 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard