WEEKNUM DAX Function (Date and Time)

Returns the week number in the year.

Syntax

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

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.

Remarks

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: Oct 13, 2018   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo, Daniil Maslyuk

MSDN documentation: https://msdn.microsoft.com/en-us/query-bi/dax/weeknum-function-dax

DAX Conventions
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.

Deprecated

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

Deprecated

This parameter is deprecated and its use is not recommended.

Contribute

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.