web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power automate desktop
Power Automate
Unanswered

Power automate desktop

(0) ShareShare
ReportReport
Posted on by

how to calculate last Friday date in power automate desktop 

I have the same question (0)
  • Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 on at

    @Meenakshi11 

     

    Do you want last friday of the month or last friday of the current date?

  • Meenakshi11 Profile Picture
    on at

    last Friday date of current date in power automate desktop 

  • Verified answer
    Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 on at

    @Meenakshi11 

     

    Please follow the below approach:

    Deenuji_0-1716385273231.png

     

    code(copy and paste into your power automate desktop):

    DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateAndTime CurrentDateTime=> CurrentDateTime
    SET Day TO CurrentDateTime.DayOfWeek
    LOOP WHILE ($'''True''') = ($'''True''')
     IF CurrentDateTime.DayOfWeek <> $'''Friday''' THEN
     DateTime.Add DateTime: CurrentDateTime TimeToAdd: -1 TimeUnit: DateTime.TimeUnit.Days ResultedDate=> CurrentDateTime
     ELSE
     Display.ShowMessageDialog.ShowMessage Title: $'''Info''' Message: CurrentDateTime Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
     EXIT LOOP
     END
    END

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard