WEEKNUM DAX Function (Date and Time)

Returns the week number in the year.


WEEKNUM ( <Date> [, <ReturnType>] )
Parameter Attributes Description

A date in datetime format.

ReturnType Optional

A number that determines the return value: for example, use 1 when week begins on Sunday, or use 2 when week begins on Monday, or use 21 for ISO week numbers. More details in Remarks section.

Return values

Scalar A single integer value.

The week number for the given date.


If the argument is a string, it is translated into a datetime value using the same rules applied by the DATEVALUE function.

There are two systems used for this function:

  • System 1 The week containing January 1 is the first week of the year, and is numbered week 1.
  • System 2 The week containing the first Thursday of the year is the first week of the year, and is numbered as week 1. This system is the methodology specified in ISO 8601, which is commonly known as the European week numbering system.
Return_type Week begins on System
1 or omitted Sunday 1
2 Monday 1
11 Monday 1
12 Tuesday 1
13 Wednesday 1
14 Thursday 1
15 Friday 1
16 Saturday 1
17 Sunday 1
21 Monday 2

Related functions

Other related functions are:

Last update: Jan 11, 2021   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo, Daniil Maslyuk

MSDN documentation: https://docs.microsoft.com/en-us/dax/weeknum-function-dax

2018-2021 © SQLBI. All rights are reserved. Information coming from MSDN is property of Microsoft Corp. » Contact us   » Privacy Policy & Cookies

Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.


Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.


This function is deprecated. Jump to the Alternatives section to see the function to use.


This parameter is deprecated and its use is not recommended.

DirectQuery compatibility

Limitations are placed on DAX expressions allowed in measures and calculated columns.
The state below shows the DirectQuery compatibility of the DAX function.


Want to improve the content of WEEKNUM? Did you find any issue?
Please, report it us! All submissions will be evaluated for possible updates of the content.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.