Weekday and WeekNum functions in Power Apps

1. Weekday function in Power Apps

The Weekday function returns the weekday of a Date/Time value.

Power Apps Syntax Weekday(DateTime [, StartOfWeek ] )

The following table list the values and their description for the StartOfWeek parameter:

StartOfWeek ParameterDescription
StartOfWeek.SundayIt returns number 1 for Sunday through 7 for Saturday. This is the default.
StartOfWeek.MondayIt returns number 1 for Monday through 7 for Sunday.
StartOfWeek.MondayZeroIt returns number 0 for Monday through 6 for Sunday.
StartOfWeek.TuesdayIt returns number 1 for Tuesday through 7 for Monday.
StartOfWeek.WednesdayIt returns number 1 for Wednesday through 7 for Tuesday.
StartOfWeek.ThursdayIt returns number 1 for Thursday through 7 for Wednesday.
StartOfWeek.FridayIt returns number 1 for Friday through 7 for Thursday.
StartOfWeek.SaturdayIt returns number 1 for Saturday through 7 for Friday.

Example: For the following example, the current date is Friday, April 21, 2015.
a) The expression returns the current day of the week in the format of a number from 1 (Sunday) to 7 (Saturday). We can replace Today() with any other date value that we want to retrieve the day of the week for.

Power Apps Formula

Weekday(Today())
Weekday function in Power Apps

b) The second argument specifies the start day of the week.

Power Apps Formula

Weekday(Today(), StartOfWeek.Monday)
Weekday function in Power Apps

c) The excel code 14 specifies the start day of the week is Thursday.

Power Apps Formula

Weekday(Today(), 14)
Weekday function in Power Apps

2. WeekNum function in power apps

The WeekNum function in Power Apps is used to return the week number of a specified date based on a specified start day of the week.

Power Apps Syntax WeekNum(Date [, StartDayOfWeek])

The function has the following parameters:

Example: Here is an example of how to use the WeekNum function:

Power Apps Formula

WeekNum(DateValue("2023-04-21"), 2)

This will return the week number of April 21, 2023, assuming that the week starts on Monday (the second day of the week). The result will be a number between 1 and 53, depending on the week of the year.