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 Apps / Getting Start of Week ...
Power Apps
Unanswered

Getting Start of Week (Monday) from a Week Number

(1) ShareShare
ReportReport
Posted on by 226 Moderator

I have a data source that only provides a week number for the content.

 

I need to generate the date for the Monday in that week..  I have found examples of how to get the date for something that is specific to date but nothing that references a number that equals the WeekNum.

 

DateAdd(Today(), 1 - Weekday(Today(), StartOfWeek.Monday), TimeUnit.Days);

 

Any guidance is appreciated.

 

Cheers

Categories:
I have the same question (0)
  • Verified answer
    Sam_Fawzi Profile Picture
    750 Super User 2025 Season 2 on at

    Here’s the step-by-step method to achieve this:

    1. Determine the first day of the year: Start with January 1st of the given year.
    2. Calculate the number of days to add: Subtract the weekday of January 1st from the week number multiplied by 7, then subtract the result of Weekday(January 1st) to align to Monday.

    Here's a formula you can use in PowerApps:

     

    // Define the year and week number
    Set(Year, 2024);
    Set(WeekNum, 10);
    
    // Get the first day of the year
    Set(FirstDayOfYear, Date(Year, 1, 1));
    
    // Calculate the number of days to add to get to the Monday of the specified week
    Set(DaysToAdd, ((WeekNum - 1) * 7) + (2 - Weekday(FirstDayOfYear, StartOfWeek.Monday)));
    
    // Get the date of the Monday in the specified week
    Set(MondayDate, DateAdd(FirstDayOfYear, DaysToAdd, TimeUnit.Days));

     

     

    This formula ensures that you correctly calculate the date of the Monday for the given week number, taking into account that the week starts on Monday.

     

  • Hack-7 Profile Picture
    226 Moderator on at

    @samfawzi_acml thanks for this.  I had missed the part of setting up the first day of the year.

    Cheers

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard