WEEKDAY
The day of the week of a date, 1 to 7 from Sunday by default; other types start the week on another day, or count Monday as 0.
Group: Date and time. Compatible with DAX.
Syntax
WEEKDAY ( <date> [, <return_type>] )
| Parameter | Type | Description |
|---|---|---|
date | Date | The date whose day of the week is wanted. |
return_type | Whole number optional | How the days are numbered: 1 (when left out) Sunday 1 to Saturday 7; 2 Monday 1 to Sunday 7; 3 Monday 0 to Sunday 6; 11 to 17 a week that starts on Monday (11), Tuesday (12) and so on to Sunday (17), numbered 1 to 7. |
Returns
Whole number. The day's number in its week.
Remarks
- A blank date gives BLANK. A number is a date number: day 0, 30 December 1899, was a Saturday.
- Any other numbering, a blank one included, is an error.
- With type 2,
WEEKDAY ( date, 2 ) > 5picks out Saturdays and Sundays.
Examples
A Sunday and a Monday, three ways
17 March 2024 was a Sunday.
EVALUATE
VAR Sunday = DATE ( 2024, 3, 17 )
VAR Monday = DATE ( 2024, 3, 18 )
RETURN
ROW (
"Sunday, 1", WEEKDAY ( Sunday ), "Sunday, 2", WEEKDAY ( Sunday, 2 ), "Sunday, 3", WEEKDAY ( Sunday, 3 ),
"Monday, 1", WEEKDAY ( Monday ), "Monday, 2", WEEKDAY ( Monday, 2 ), "Monday, 3", WEEKDAY ( Monday, 3 )
)
| Sunday, 1 | Sunday, 2 | Sunday, 3 | Monday, 1 | Monday, 2 | Monday, 3 |
|---|---|---|---|---|---|
| 1 | 7 | 6 | 2 | 1 | 0 |
Weeks that start on other days
EVALUATE
VAR Monday = DATE ( 2024, 3, 18 )
RETURN
ROW ( "From Monday", WEEKDAY ( Monday, 11 ), "From Wednesday", WEEKDAY ( Monday, 13 ),
"From Sunday", WEEKDAY ( Monday, 17 ) )
| From Monday | From Wednesday | From Sunday |
|---|---|---|
| 1 | 6 | 2 |
Price days by day of the week
Prices are quoted on working days only: no 6 or 7.
EVALUATE
GROUPBY (
ADDCOLUMNS ( VALUES ( Prices[Date] ), "Weekday", WEEKDAY ( Prices[Date], 2 ) ),
[Weekday],
"Days", COUNTX ( CURRENTGROUP (), 1 )
)
ORDER BY [Weekday]
| Weekday | Days |
|---|---|
| 1 | 154 |
| 2 | 154 |
| 3 | 155 |
| 4 | 154 |
| 5 | 154 |
Related functions
WEEKNUM, NETWORKDAYS, DAY, FORMAT.