Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Getting Start of Week (Monday) from a Week Number

(1) ShareShare
ReportReport
Posted on by 216 Super User 2025 Season 1

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

  • Hack-7 Profile Picture
    216 Super User 2025 Season 1 on at
    Re: Getting Start of Week (Monday) from a Week Number

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

    Cheers

  • Verified answer
    SamFawzi-SmartSolutions Profile Picture
    258 Super User 2025 Season 1 on at
    Re: Getting Start of Week (Monday) from a Week Number

    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.

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,017 Most Valuable Professional

Leaderboard