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 / GET WEEK NUMBER FROM C...
Power Automate
Unanswered

GET WEEK NUMBER FROM CURRENT DATE

(0) ShareShare
ReportReport
Posted on by 292

Hello All,

 

I would want some help to get the week number of current date. I have added the below function to get the current date. If some one could help me to get the week number it would be of great help.

 

convertFromUtc(utcNow(),'India Standard Time','dd/MM/yyyy')
Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    Try this formula

    add(div(dayOfYear(utcNow()),7),1)

     

  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    @nagaraj007 

     

    @Pstork1  formula works 🙂

     

    You can also find some more ideas in the comments for the thread, https://powerusers.microsoft.com/t5/Power-Automate-Ideas/How-to-calculate-week-number-in-a-year-in-flows/idi-p/104499 

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • nagaraj007 Profile Picture
    292 on at

    Will it work for all years? As I saw in one of the forums the below function works only for 2019. Please confirm. @Pstork1 

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    The function should work for any year.  It is currently based on UTC.  If you want it for India time zone then use this one.

    add(div(dayOfYear(convertFromUtc(utcNow(),'India Standard Time','U')),7),1)

     

  • Amanthaper Profile Picture
    441 on at

    edited -

  • PedrohMoreira Profile Picture
    2 on at

    Does this also work on Power Automate Desktop?

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    Power Automate Desktop doesn't use the same functions as Power Automate, so no I don't think it will work.

  • OliverR-82 Profile Picture
    619 on at

    It doesn't seem to work in 2021. It returns '21' for me today while we're currently in week 20, according to my calendar. I suppose I could replace the '1' in the formula with '2' but then it will likely not work correctly for next year, I would expect?

     

    EDIT: or it could be because my calendar uses the ISO week number, which always starts on a Monday. That would explain. Unfortunately, that's the one I need. I'll try the method described here. It's more complex but if it does the job, then great.

  • ENRM Profile Picture
    122 on at

    @nagaraj007 

    Use the WeekNum and ISOWeekNum functions to determine the week number of a date.

    These functions differ in how they determine the first week of the year (week 1):

    • WeekNum uses the week containing January 1 as the first week of the year. The result from this function can range from 1 to 54.

    • ISOWeekNum uses the week containing the first Thursday of the year as the first week of the year. This follows the ISO 8601 date and time standard definition for week numbering. The result from this function can range from 1 to 53. It is possible that 52 or 53 may be returned for the first days of January since the dates could belong to the last week of the previous year.

    Use the second parameter to WeekNum to specify which day begins a week. You can provide either an Excel code number or use the StartOfWeek enumeration:


    1, 17StartOfWeek.SundayWeek begins on Sunday. Default.
    2, 11StartOfWeek.MondayWeek begins on Monday.
    12StartOfWeek.TuesdayWeek begins on Tuesday.
    13StartOfWeek.WednesdayWeek begins on Wednesday.
    14StartOfWeek.ThursdayWeek begins on Thursday.
    15StartOfWeek.FridayWeek begins on Friday.
    16StartOfWeek.SaturdayWeek begins on Saturday.

     

    ISOWeekNum always uses Monday as the start of the week. In Excel, the WeekNum function supports an addition code 21 that is not supported here; use ISOWeekNum instead.

    If you pass a single number to these functions, the return value is a single result. If you pass a single-column table that contains numbers, the return value is a single-column table of results, one result for each record in the argument's table. If you have a multi-column table, you can shape it into a single-column table, as working with tables describes.

    Syntax

    WeekNum(DateTime [, StartOfWeek ])

    • DateTime - Required. Date/Time value to operate on.
    • StartOfWeek - Optional. Excel code or StartOfWeek enumeration that determines which day the week begins.

    ISOWeekNum(DateTime)

    • DateTime - Required. Date/Time value to operate on. The week always begins on Monday.
  • Community Power Platform Member Profile Picture
    on at

    Anyone managed to get the ISO week number working?

    Would love to see an example.

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