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 / How to Subtract 1 week...
Power Automate
Answered

How to Subtract 1 week from current iso week

(0) ShareShare
ReportReport
Posted on by 24

Hi All,

I have a query about showing last week in Power Automate from current week.

I got current iso week by using expression(

div(add(dayofyear(addDays(subtractFromTime(utcNow(), if(equals(dayofweek(utcNow()),0),1,sub(dayofweek(utcNow()),6)), 'Day'),3)),6),7)).

this is for WK 05 2023 and want to show WK04.

can anyone help me with the steps and expressions.

 

Categories:
  • ScottShearer Profile Picture
    25,331 Most Valuable Professional on at

    @hcsharma19 

    Try this:

    div(dayOfYear(utcNow()),7)
     
  • hcsharma19 Profile Picture
    24 on at

    Hello Scott,

    Thanks for the update.

    However, this will only give me the current week.

    my requirement is to add the last week(i.e, we are in ISOWK 05 2023, but want to add WK04 2023).

     

  • Verified answer
    ScottShearer Profile Picture
    25,331 Most Valuable Professional on at

    @hcsharma19 

    I did not appreciate that you want ISO week (although you said that...).

    Why not just use and add() expression:

    add(div(add(dayofyear(addDays(subtractFromTime(utcNow(), if(equals(dayofweek(utcNow()),0),1,sub(dayofweek(utcNow()),6)), 'Day'),3)),6),7)),-1)

  • hcsharma19 Profile Picture
    24 on at

    Hello Scott, it worked Thanks.
    Can you help me with expression for showing last month(i.e we are in Feb-2023 and want to show Jan-2023 in mail body).
    Also, how to show only ISO year.

    Thanks 

  • Verified answer
    Chriddle Profile Picture
    8,729 Super User 2026 Season 2 on at

    Last month:

    addDays(startOfMonth(utcNow()), -1, 'MMM-yyyy')

     

    Current year:

    formatDateTime(utcNow(), 'yyyy')

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 211 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 190

Last 30 days Overall leaderboard