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 :
Power Automate - Building Flows
Suggested answer

last day of next month

(0) ShareShare
ReportReport
Posted on by 30
Hi All
 
I have a flow which runs on the last day of each month. At the moment I have to go into the flow on the first of each month and set it again for the last day. 
 
Each time the flow executes I want to store the last day of the month for next month within a variable and use the variable to trigger the flow. 
 
I'm thinking get the start of the month add two months and subtract a day. 
 
I've got the start of the month fine its just the adding two months and subtracting a day I can't get working. 
 
Any help much appreciated. 
 
Thanks
 
 
I have the same question (0)
  • Chriddle Profile Picture
    8,331 Super User 2025 Season 2 on at
    last day of next month
    Not very elegant, but I can't come up with something beter:
     
    - Schedule the flow to run once a day
    - Check if utcNow('yyyy-MM-dd') equals the following expression (last day of the current month):
    addDays(
    	startOfMonth(
    		addDays(
    			startOfMonth(utcNow()),
    			32
    		)
    	),
    	-1,
    	'yyyy-MM-dd'
    )
    - If not, terminate the flow
     
    Note that your local date must match the UTC date at the time your flow runs.
    Otherwise, things get more complicated.
  • Suggested answer
    David_MA Profile Picture
    12,515 Super User 2025 Season 2 on at
    last day of next month
    If you start the schedule of the flow on a month that has 31 days, and set the interval to 1 month, the flow will run on the last day regardless of the number of days in the month. 
     
    I have been testing this method for several months now and it seems to work. I cannot find this documented anywhere, but Run flows on a schedule in Power Automate - Power Automate | Microsoft Learn does note: If you run a flow on the month frequency, the flow runs on the same date each month.

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…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 650 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 341 Moderator

#3
developerAJ Profile Picture

developerAJ 256

Last 30 days Overall leaderboard