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 Automate
Unanswered

Last Day of Month

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

How to get last date of every month

I have the same question (0)
  • UK_Mike Profile Picture
    on at

    Not sure about every month but I have last month and this month ?

    Would just be adding months surely ?

    Can paste the code if this helps ?

     

    Screenshot 2022-04-12 202947.png

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @UK_Mike ,

     

    Let me try,

    Can you post the entire window along with actions you placed.

     

    I'm

    Balamurugan2022

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    https://www.linkedin.com/pulse/power-automate-desktop-pad-best-practices-part-1-date-michael-annis

    everything you are looking for. Best of luck!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @MichaelAnnis ,

     

    Thanks for post, let me try,

     

    I'm

    Balamurugan2022

  • UK_Mike Profile Picture
    on at

    Sure...

     

    DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateOnly CurrentDateTime=> CurrentDateTime
    DateTime.Add DateTime: CurrentDateTime TimeToAdd: -1 TimeUnit: DateTime.TimeUnit.Months ResultedDate=> PreviousMonth
    Text.ConvertDateTimeToText.FromCustomDateTime DateTime: PreviousMonth CustomFormat: $'''01/MM/yyyy''' Result=> FormattedDateTime
    Text.ConvertTextToDateTime.ToDateTimeCustomFormat Text: FormattedDateTime CustomFormat: $'''dd/MM/yyyy''' DateTime=> FirstDayOfLastMonth
    DateTime.Add DateTime: FirstDayOfLastMonth TimeToAdd: 1 TimeUnit: DateTime.TimeUnit.Months ResultedDate=> FirstDayOfThisMonth
    DateTime.Add DateTime: FirstDayOfThisMonth TimeToAdd: -1 TimeUnit: DateTime.TimeUnit.Days ResultedDate=> LastDayofPreviousMonth
    DateTime.Add DateTime: LastDayofPreviousMonth TimeToAdd: 1 TimeUnit: DateTime.TimeUnit.Months ResultedDate=> LastDateOfMonth
    Display.ShowMessageDialog.ShowMessage Message: $'''%FirstDayOfLastMonth%
    %FirstDayOfThisMonth%
    %LastDayofPreviousMonth%
    %LastDateOfMonth%''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed

    # [ControlRepository][PowerAutomateDesktop]

    {
    "ControlRepositorySymbols": [],
    "ImageRepositorySymbol": {
    "Name": "imgrepo",
    "ImportMetadata": {},
    "Repository": "{\r\n \"Folders\": [],\r\n \"Images\": [],\r\n \"Version\": 1\r\n}"
    }
    }

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 959

#2
Valantis Profile Picture

Valantis 872

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard