This tutorial is about how to get current and previous month in Power Automate. I will show you some examples of how to get the current month in Power Automate and how to get the previous month in Power Automate.
Here are the examples we will see:
- How to get a current month number in a Power Automate.
- How to obtain the current month’s name in Power Automate.
- How to retrieve the current month’s abbreviation in Power Automate.
Get Current Month in Power Automate
In Power Automate, the formatDateTime() function is available to retrieve the current month using utcNow in a flow. With this format DateTime function, a user can display a particular format of date and time irrespective of the user’s system settings.
Formats for Month that can include in formatDateTime() function:
MMMM- Month name -October
MMM- Month abbreviation -Oct
MM-Month number -10
A step-by-step guide to get the current month in Power Automate flow:
Get current month number in Power Automate
Open a Power Automate Home page by logging through your Microsoft credentials. Next, create a manual trigger flow in Flow Studio. Then, take an Initialized variable and fill in the below details:
- Name: Give a name for an initialized variable.
- Type: Select datatype from the drop-down.
- Value: Provide the below code in the value section.
int(formatDateTime(utcNow(),'MM'))

To see the output, add a Compose data operation and take the Input value that is generated from an initialized variable.
@{variables('Current Month Number')}

Get current month name in Power Automate
Let us see how to get the current month’s name in Power Automate.
- In the initialized variable, set the below details:
- Name: Provide a name for an initialized variable.
- Type: Select datatype as ‘String ‘ from the drop-down.
- Value: Provide the below-given expression in the value column.
formatDateTime(utcNow(),'MMMM')

- In the Compose action, take value from the dynamic content of variables as shown below:
@{variables('Current Month')}

Get Current Month Abbreviation in Power Automate
- Similarly, set the Value of an initialized variable as given in the below code.
- Name: Give a name for the variable.
- Type: Select a data type as ‘ String ‘from the drop-down.
formatDateTime(utcNow(),'MMM')

- To check the output, add Compose action and give below details:
- Inputs: Select the output value that comes with variables under dynamic content.
@{variables('Current Month')}

- Once the flow has been created, click on Save and Test Manually.

Today’s Date is 11-10-2023 (dd-MM-yyyy) format.
The below image shows the output for the current month’s number:

The image placed below will represent the output for the current month’s name:

Below shown screenshot will display the output for the current month’s abbreviation:

This is how to get the current month in Power Automate using the formatDateTime() function.
Get Previous Month in Power Automate
Now, let us check out how to get the previous month in Power Automate. I have taken four examples based on the previous month in Power Automate.
- How to get the previous month in Power Automate
- Get the previous month’s name in Power Automate
- Power Automate returning the first day of the previous month
- How to get the last day of the previous month in Power Automate
1. Navigate to https://make.powerautomate.com/ and click on + Create -> select “Instant cloud flow”. In the next window, provide a flow name, select “Manually trigger a flow”, and click on Create.
2. Next, add an “Initialized variable” to store the value and be used during the flow. Here, provide the details below:
- Name: Set a name for an initialized variable.
- Type: Select datatype as ‘String‘ from the drop-down.
- Value: Add the below code in value.
addToTime(utcNow(),-1,'month','yyyy-MM-dd')

3. Then, add a Compose data operation to check the output from an initialized variable.
- Inputs: Select output from variables under dynamic content.
@{variables('Previous Month')}

4. Now, the flow is ready, and we can test it. Save the flow and Click on Test -> Manually to test flow.

5. This is the output received from the compose flow action i.e. Previous Month Date.

This is how to get the previous month using the formatDateTime() in a Power Automate flow.
Get the previous month’s name using Power Automate
Similarly, here based on the current date (13-10-2023) in Power Automate, I will show you how to get the previous month’s name inside a flow.
Let us get the previous month’s name based on the utcNow() function using the add to Time formula in a Power Automate flow.
Follow the below step-by-step instructions to create an instant cloud flow:
1. Click App Launcher -> Select Power Automate and click on +Create -> Select “Instant cloud flow”. In the next window, provide a flow name, choose “Manually trigger a flow” and click on Create.
2. When the trigger is added to the flow, select an “Initialized variable” flow action and set the details below.
- Name: Set a name for a variable.
- Type: Select datatype as ‘String’ from drop-down.
- Value: Provide the below expression in value.
addToTime(utcNow(),-1,'month','MMMM')

3. Then, add a “Compose” data operation and give input value from the dynamic content of an initialized variable.
@{variables('Previous Month Name')}

4. Once the flow has been created. Save it. Click on Test -> Manually to test flow.

5. The output generated from the initialized variable will display the previous month’s name.

This is how to work on the Power Automate formatDateTime() function to get the previous month’s name inside a flow.
Get the start day of the previous month in Power Automate
Now, I will show you how to get the start day of the previous month in a Power Automate flow based on the current date (13-10-2023).
Here, I will follow the same steps to create a Power Automate flow and I will use this time different function in an initialized variable to get the start day of the previous month.
Follow the below instructions to build a Power Automate flow.
1. In the initialized variable, provide the below expression in value and set details like:
- Name: Provide a name for a variable.
- Type: Select datatype from the drop-down.
- Value: Add the below code in the value section.
startOfMonth(addToTime(utcNow(),-1,'Month'),'MMM dd,yyyy')

2. Next, add a Compose data operation to check the output from an initialized variable.
- Inputs: Select output from dynamic content.
@{variables('Previous Month')}

3. The outputs of compose will show the start day of a previous month inside a flow.

This is how to extract the start day of a previous month using Power Automate flow.
Get the last day of the previous month in Power Automate
In this section, I will explain the final example i.e., Power Automate, how to get the previous month’s last day using a flow.
Follow the above-mentioned steps to create a Power Automate flow that will get the last day of the previous month using the utcNow() function in it.
This means it will get the previous month’s last day, i.e. (30- Sep-2023) with the current date (14-10-2023).
1. In the initialized variable, Add the below code in the value section.
subtractFromTime(startOfMonth(addToTime(utcNow(),0,'month')),1,'day','dddd, MMMM dd,yyyy')

2. Then, add a Compose data operation to check the output from an initialized variable.
@{variables('Last day')}

3. The outputs of compose will show the last day of a previous month inside a flow.

This is how to get the last day of a previous month by using Power Automate functions inside a flow.
Conclusion
I hope you got an idea of how to get the current month in Power Automate. Also, I have explained how to get the previous month in Power Automate with a few examples like below:
- Get the current month number in Power Automate
- Get the current month’s name in Power Automate
- Get Current Month Abbreviation in Power Automate
- Get the previous month’s name using Power Automate
- Get the start day of the previous month in Power Automate
- Get the last day of the previous month in Power Automate
You may also like:
- Power Automate odata date filter last 30 days
- How to Get Current Year in Power Automate?
- How to Get Current Date in Power Automate?
- How to get start and end of month in Power Automate?

Preeti Sahu is an expert in Power Apps and has more than 6 years of experience working with SharePoint and the Power Platform. As a Power Platform expert for Power BI, Power Apps, Power Automate, Power Virtual Agents, and Power Pages, she is currently employed with TSinfo Technologies. She is the author of the book Microsoft Power Platform A Deep Dive. She also made a big technical contribution to SharePointDotNet.com in the form of articles on the Power Platform. She enjoys traveling and spending time with her family in her spare time.