WEEKDAY

Returns a number from 1 to 7 identifying the day of the week of a date. By default the day ranges from 1 (Sunday) to 7 (Saturday).

Syntax

WEEKDAY (<date>, <return_type>)

Parameters

TermDefinition
dateA date in datetime format.

Dates should be entered by using the DATE function, by using expressions that result in a date, or as the result of other formulas.
return_typeA number that determines the Return value:

Return type: 1, week begins on Sunday (1) and ends on Saturday (7). numbered 1 through 7.

Return type: 2, week begins on Monday (1) and ends on Sunday (7).

Return type: 3, week begins on Monday (0) and ends on Sunday (6).numbered 1 through 7.

Return value

An integer number from 1 to 7.

Remarks

In contrast to Microsoft Excel, which stores dates as serial numbers, DAX works with dates and times in a datetime format. If you need to display dates as serial numbers, you can use the formatting options in Excel.

You can also type dates in an accepted text representation of a date, but to avoid unexpected results, it is best to convert the text date to a datetime format first.

When the date argument is a text representation of the date, the function uses the locale and date/time settings of the client computer to understand the text value in order to perform the conversion. If the current date/time settings represent dates in the format of Month/Day/Year, then the string, “1/8/2009”, is interpreted as a datetime value equivalent to January 8th of 2009. However, if the current date/time settings represent dates in the format of Day/Month/Year, then the same string would be interpreted as a datetime value equivalent to August 1st of 2009.

Example

The following example gets the date from the [HireDate] column, adds 1, and displays the weekday corresponding to that date. Because the return_type argument has been omitted, the default format is used, in which 1 is Sunday and 7 is Saturday. If the result is 4, the day would be Wednesday.

=WEEKDAY([HireDate]+1)  

See also

Date and time functions
WEEKNUM function
YEARFRAC function

***** Related Blog Posts *****
60 Page DAX Formula Reference Guide Download Now Available
Show Only Top Or Bottom Results Using Ranking Formula Techniques – Power BI & DAX

***** Related Video Tutorials *****
Ultimate Beginners Guide to DAX

What Is DAX? & Why Do You Need To Learn It – (1.2) Ultimate Beginner Guide to DAX
Formula Syntax, Comments & Variables – (1.6) Ultimate Beginners Guide to DAX
Examples Of Advanced DAX – (1.18) Ultimate Beginners Guide to DAX

***** Related Course Modules *****
Ultimate Beginners Guide to DAX
Mastering DAX Calculations
Solving Analytical Scenarios w/ Power BI and DAX
DAX Formula Deep Dives
Advanced DAX Combinations

***** Related Support Forum Posts*****
Mastering DAX Calculations: What Is DAX?
Understanding DAX Formula
Developing Complex Dax functions
Data Types And Operators