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 / Set a field to the fir...
Power Apps
Unanswered

Set a field to the first Wednesday of the next month

(0) ShareShare
ReportReport
Posted on by 9

Hi All,

 

I have a need to set a field to the first Wednesday of the month after a date specified in a date picker. The field will not be visible, and it could be a Date/Time type, or a Single Line of Text type.  It will be stored in a Sharepoint list, so that field can change to match the Power App approach.  Or the calculation could be done in Sharepoint.

 

I found the following (which works for the first Friday of the next month) on another forum

=IF(WEEKDAY(DATE(YEAR(Data1);MONTH(Data1)+1;1))=1;DATE(YEAR(Data1);MONTH(Data1)+1;1+1);IF(WEEKDAY(DATE(YEAR(Data1);MONTH(Data1)+1;1))=7;DATE(YEAR(Data1);MONTH(Data1)+1;1+2);IF(WEEKDAY(DATE(YEAR(Data1);MONTH(Data1)+1;1))=6;DATE(YEAR(Data1);MONTH(Data1)+1;1+3);IF(WEEKDAY(DATE(YEAR(Data1);MONTH(Data1)+1;1))=5;DATE(YEAR(Data1);MONTH(Data1)+1;1+4);IF(WEEKDAY(DATE(YEAR(Data1);MONTH(Data1)+1;1))=4;DATE(YEAR(Data1);MONTH(Data1)+1;1+5);IF(WEEKDAY(DATE(YEAR(Data1);MONTH(Data1)+1;1))=3;DATE(YEAR(Data1);MONTH(Data1)+1;1+6);DATE(YEAR(Data1);MONTH(Data1)+1;1)))))))

 an adapted it in various ways, but I could not get it to work.  Among my issues:

- attempting to create a calculated field in Sharepoint:  formula too long - it was truncated,

- attempted to place in the default value of a Date/Time field in Power Apps

- attempted to place in a "Single Line of Text" field in Power Apps

- attempted to place as text in a label in Power Apps.

 

The Power App errors were too long to correct!

 

Nothing worked.  Any help would be greatly appreciated!

Categories:
I have the same question (0)
  • Verified answer
    timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    Hi @dloseff 

    This formula will return the 1st Wednesday of the next month. You would need to replace DatePicker1 with the name of your date picker.

    With(
     {
     FirstOfNextMonth: DateAdd(
     Date(
     Year(DatePicker1.SelectedDate),
     Month(DatePicker1.SelectedDate),
     1
     ),
     1,
     Months
     )
     },
     DateAdd(
     FirstOfNextMonth,
     7 - Weekday(
     DateAdd(
     FirstOfNextMonth,
     3
     )
     )
     )
    )

     

    timl_0-1628932876480.png

     

  • dloseff Profile Picture
    9 on at

    Wonderful!  Thanks so much for your quick, simple and accurate response!  Worked like a charm

  • dloseff Profile Picture
    9 on at

    So here is a new twist to this request.  Originally I needed to find the first Wed of the month after a selected date.  The selected date is a new employee's start date, the first Wednesday of the next month is the date of new employee orientation.  But the twist is this:  if the employee starts on a date in the same month as, but prior to the first Wed, then their orientation would be on that month's first Wed.  As an example, if an employee starts on Friday, Oct. 1, they should be scheduled for the orientation taking place on Wed, Oct 6, not Wed, Nov 1.  Any ideas on how to approach this?  Thanks!

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard