Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

Schedule Power Automate flow to run only last Friday of the month

Posted on April 10, 2022April 10, 2022 by Tom

“I’d like to send a reminder on the last Friday in each month, how can I schedule it in Power Automate given various month length?”


When scheduling recurrent flows for a specific day in a month, it can go two ways. You can get the day from the beginning of a month, e.g. first or second Tuesday in a month, or you can take it from the end. While taking it from the beginning is very straightforward, from the end it’s a bit more complicated due to the different length of each month. The day must be always within the last 7 days of the month, but how do you get it if a month can have between 28 and 31 days?

Get the last day of the month

Since each month can have a different number of days, the first step is to get the number for the current month. Unfortunately, Power Automate doesn’t have any expression that would give you the end of a month, but it has an expression to give you the start of a month. Using the startOfMonth(…) expression you’ll get start of the current month, no matter what day it is today.

startOfMonth(utcNow())

But that’s the start of this month and you need the end of this month, which is exactly 1 month – 1 day away from the start. Add a month to that date, and remove 1 day with addToTime(…) and addDays(…) expressions. Using the ‘dd’ format you’ll get only the number for the last day in the current month.

addDays(addToTime(startOfMonth(utcNow()),1,'Month'),-1,'dd')
Power Automate schedule last of the month

Check if today’s date is in the last 7 days

Now, when you’ve got the last date in the month, you can use it in a trigger condition. If it’s the last Friday (or any other day) in the month, it must be in the last 7 days. That means you’ll need borders, the day must be between the last day of the month and the last day of the month -6 days.

Use the expression above as one of the borders, the last day of the month. The other expression would then be very similar, subtracting 7 days instead of 1.

addDays(addToTime(startOfMonth(utcNow()),1,'Month'),-7,'dd')

Convert the number into an integer with the int(…) expression, and check if today’s date fits in between: last day of the month -6 <= today <= last day of the month.

@and(
lessOrEquals(int(utcNow('dd')),int(addDays(addToTime(startOfMonth(utcNow()),1,'Month'),-1,'dd'))),
greaterOrEquals(int(utcNow('dd')),int(addDays(addToTime(startOfMonth(utcNow()),1,'Month'),-7,'dd')))
)

You can then use it as a trigger condition in the recurrence trigger.

Such trigger condition will guarantee that the flow will run only if it’s the last week in the month. Combine it with the specific day and you’re done.

Summary

It’s a bit more complicated to schedule a Power Automate flow to run on the last specific day of the month than scheduling it from the beginning. Before you start comparing the dates you must get the dates for the last 7 days in each month, but from then on it’s the same approach. Select which day it should be, and check if the date fits in the range of the last 7 days.


πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

4 thoughts on “Schedule Power Automate flow to run only last Friday of the month”

  1. a says:
    May 26, 2022 at 2:52 am

    good post. thank you!

    Reply
  2. MT says:
    March 22, 2024 at 2:31 am

    How do I test out my scheduled flow on Power Automate to make sure that it sends on every last Thursday of the month? Do I have to enter the start date as 1 April 2024, so that the email will be sent on 28 March 2024, and subsequently will continue running every 4 weeks on every last Thursday?

    Reply
    1. Tom says:
      April 17, 2024 at 10:15 pm

      Hello MT,
      the best way would be to wait until the last Thursday, but I guess that’s not always the option. I do it by adjusting the logic towards the nearest day, e.g. 1st Thursday to validate the functionality and then just change the numbers to make it the 4th Thursday while making a note to check it on that exact day again (and fix it if it doesn’t work properly).

      Reply
  3. Bill says:
    May 10, 2024 at 3:41 pm

    Very helpful! What’s the best way to make this work for every other month?

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Working on an Approval process?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy a fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes