Skip to content

Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Problems
  • Triggers
  • Application specific solutions
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Resources
Menu

How to add month(s) to a date in Power Automate

Posted on January 27, 2021April 14, 2021 by Tom

“I’d like to add exactly one month to a date in Power Automate. Not 30 days but a full month: 28, 29, 30 or 31 days.”


Like many other operations in Power Automate, you must find the right action or expression to add month(s) to a date. You could use the common addDays(…) expression to add a specific number of days, but what number do you use? Do you use 30 as an average for all months? Even if it’s not 30 each month? That could make a difference in days from the desired date.

What’s the action or expression to use then? Actually, there’re both options: action and expression.

addToTime(…) expression

Let’s take a look on the expression first. Power Automate has an expression addToTime(…) to add various time units. It expects 4 parameters: date, how many units to add, what time units these are, and format.

addToTime([Date], [number], '[units]', '[format]')

example to take today's date, add 12 Months, and format as year-month-date (2021-01-27)
addToTime(utcNow(),12,'Month','yyyy-MM-dd')

Notes:
[Date] is the base date
[number] is a number of the [units] to add
[units] is the time period: Second, Minute, Hour, Day, Week, Month or Year
[format] is optional, it's up to you if you want to format the result in any way
power automate add month to a date

‘Add to time’ action

‘Add to time’ is an action with almost the same functionality. If you don’t want to type in an expression, you can use this action instead.

There’s one downside though, the ‘Add to time’ action doesn’t allow you to format the result date. In case you need the date in a specific format, you must format it later using a separate expression formatDateTime(…).

power automate add month to a date

Summary

As you can see above, Power Automate has often multiple solutions to a problem. One solution is using a specific action, it’s simple and user friendly, but you might miss some functionality.

The other solution, with the expression, might look complicated on the first look, but it gives you more possibilities. You don’t depend on the design of a specific action, you have full access to the underlying expression. In this case it’s the result date format.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

6 thoughts on “How to add month(s) to a date in Power Automate”

  1. Yannie says:
    January 18, 2022 at 7:25 pm

    Hi Tom. Is it possible for Power Automate to find the next month end? For example today is Nov 30 and the next month would be Dec 31 and not Dec 30. Thank you.

    Reply
    1. Tom says:
      January 19, 2022 at 10:12 am

      Hello Yannie,
      you can use the combination of addToTime(…) and startOfTheMonth(…) expression as described in this post: https://tomriha.com/filter-sharepoint-items-with-date-in-the-same-month-in-power-automate/. Get start day of this month (1st of January), add 2 months (1st of March), and remove 1 minute (28th of February at 23:59).
      addMinutes(addToTime(startOfMonth(utcNow()),2,'Month'),-1)

      Reply
      1. Yannie says:
        March 4, 2022 at 4:50 pm

        Thank you Tom! Would you know how I would find a date that is “x number of business days away from month end”? For example, I have a column called “Month End” and I want to find the 8th business after that month end date in my flow. Or perhaps you have a separate blog on this topic? Thanks again.

        Reply
        1. Tom says:
          March 6, 2022 at 6:28 pm

          Hello Yannie,
          take a look on the new blog post: https://tomriha.com/how-to-add-only-working-days-to-a-date-using-power-automate/

          Reply
  2. Sam says:
    May 28, 2022 at 10:59 am

    Hi Tom, is it possible to get list of all months and years falling between two given dates in Power automate?

    Reply
    1. Tom says:
      June 1, 2022 at 7:32 pm

      Hello Sam,
      I’d guess it is possible, but I have no idea how to do that at this moment. 🙂

      Reply

Leave a Reply Cancel reply

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

Now available:

The Ultimate Power Automate expressions cheat sheet
Equip yourself with the tool to translate your thoughts into Power Automate expressions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Hello and welcome!

My name is Tom and I'm a business process automation consultant and Microsoft MVP living in the Czech Republic. I’ve been working with Microsoft technologies for almost 10 years, currently using mainly Power Automate, SharePoint, Teams, and the other M365 tools.

I believe that everyone can automate part of their work with the Power Automate platform. You can achieve a lot by "clicking" the flows in the designer, but you can achieve much more if you add a bit of coding knowledge. And that's what this blog is about.

To make the step from no-code Power Automate flows to low-code flows: using basic coding knowledge to build more complex yet more efficient flows to automate more of your daily tasks.

  • Format results of date calculation in SharePoint columnJune 29, 2022
  • Why is your Power Automate flow creating duplicatesJune 26, 2022
  • How to create a unique identifier in your Power Automate flowJune 22, 2022
  • How to assign custom SharePoint permission level with Power AutomateJune 19, 2022
  • Remove permissions from a specific SharePoint user with Power AutomateJune 15, 2022

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

© 2022 Let's POWER Automate | Powered by Superbs Personal Blog theme