WEEKNUM DAX Function (Date and Time)
Returns the week number in the year.
Syntax
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
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: 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