DAX Function Guide

WEEKDAY
Empty image or helper icon

Sam McKay

CEO & Founder

How does the WEEKDAY work?
The WEEKDAY function (DAX) 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).
WEEKDAY Formula Syntax

WEEKDAY (
     <date>, <return_type>
)

How do you use the WEEKDAY?

You can use the WEEKDAY function inside other formulas to check the day of week and react as needed. The WEEKDAY function supports several numbering schemes. The return type argument determines which scheme used to map each day of week to a number. The return type is optional and defaults to 1.

Related Blog Posts

Loading

Considerations when using the WEEKDAY?
  1. If we omit the return_type argument, it will take the default value of 1.
  2. Microsoft Excel stores dates as sequential serial numbers so they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2009 is serial number 39448 because it is 39,813 days after January 1, 1900. Excel interprets text representations of dates differently, depending on the date settings on your computer. Therefore, the serial_number argument for the WEEKDAY function should be entered as either:
    1. A reference to a cell containing a date
    2. A date returned from another function or formula.
  3. The WEEKDAY function will return a value even when the date is empty. Take care to trap this result if blank dates are possible.
Related Video Tutorials

Loading

Formula examples using the WEEKDAY

=WEEKDAY([HireDate]+1)

=WEEKDAY(A2, 2)

=WEEKDAY(Date, [Numbers 1 (Sunday) through 7 (Saturday)])

Related Courses

Loading