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 Apps / Get the second sunday ...
Power Apps
Answered

Get the second sunday date of march for the current year

(1) ShareShare
ReportReport
Posted on by 172

I am trying to get the date for second Sunday of march month

 

Set(
    varmarchsecondsunday,
    Date(
        Year(Today()),
        3,
        Day(2)
    )
)
 
i get the 31 of the current year.
Categories:
I have the same question (0)
  • Verified answer
    poweractivate Profile Picture
    11,078 Most Valuable Professional on at

     

    // Set the year and month for which you want the second Sunday
    Set(gloYear, 2024);
    Set(gloMonth, 3); // Example: March 2024
    
    // Calculate the first day of the month
    Set(gloFirstDayOfMonth, DateValue(gloYear & "-" & gloMonth & "-1"));
    
    // Determine the day of the week for the first day of the month (0=Sunday, 1=Monday, ..., 6=Saturday)
    Set(gloFirstDayOfWeek, Weekday(gloFirstDayOfMonth) - 1);
    
    // Calculate the second Sunday
    // If the first day is Sunday, the second Sunday will be 7 plus the first day of month, otherwise calculate the second Sunday by adding the number of days needed
    Set(gloSecondSunday, 
     If(
     gloFirstDayOfWeek = 0,
     DateAdd(gloFirstDayOfMonth, 7, TimeUnit.Days),
     DateAdd(gloFirstDayOfMonth, 14 - gloFirstDayOfWeek, TimeUnit.Days)
     )
    );
    
    Set(
     varmarchsecondsunday,
     gloSecondSunday
    )

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 936

#2
Valantis Profile Picture

Valantis 604

#3
11manish Profile Picture

11manish 518

Last 30 days Overall leaderboard