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 Automate / Format Date as Last Da...
Power Automate
Suggested Answer

Format Date as Last Day Two Months Prior

(0) ShareShare
ReportReport
Posted on by 43
Hi , 
 
I want a required date . For example - if current month is january. I want to go back previous two months and get that last date 
 
For example - If today is 3rd jan2025 going back two months and get last date will be 30th nov 2024
 
Can anyone please help
Categories:
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    14,128 Super User 2026 Season 1 on at
    Use this expression: formatDateTime(addToTime(utcNow(),-2, 'Month'),'MM/dd/yyyy') and replace "MM/dd/yyyy with your desired date format. Run today, the expression returns:
  • kanha123_456 Profile Picture
    43 on at
    @David_MA can you please tell with the desktop action 
     
    For example if current month is jan2025 I want to go back two month i.e Nov2024 and get the last date of nov2024 i.e 30nov2024
  • Suggested answer
    David_MA Profile Picture
    14,128 Super User 2026 Season 1 on at
    Getting the last day of the month two months ago can be done with this expression:
     
    formatDateTime(addDays(addToTime(startOfMonth(utcNow()),-1, 'Month'),-1),'MM/dd/yyyy')

    Run today, it returns:

     
    I don't use Power Automate Desktop, so I cannot answer how to do this there. You would be better off posting your question in the Power Automate Desktop forum instead: Microsoft Power Platform Community Forum Thread
  • Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at
    Please use this.
     
    1. Get your current month first date- StartOfMonth(utcnow())
    2. Get Previous month first date - StartOfMonth(StartOfMonth(utcnow()),-1,'yyyy-MM-dd'))
    3. Then get previous to previous month last date- addDays(StartOfMonth(StartOfMonth(utcnow()),-1,'yyyy-MM-dd')),-1,'yyyy-MM-dd')
     
    So you have to use point no 3 expression to get your desired date.
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 636

#2
Valantis Profile Picture

Valantis 372

#3
11manish Profile Picture

11manish 335

Last 30 days Overall leaderboard