Forum Discussion
How to show the current week number
- 4 years ago
The problem is resolved.
this is the solution
Current Week = IF(Kalender[WeekNumber] = WEEKNUM(TODAY(),21), "Current", CONVERT(Kalender[WeekNumber],STRING))thanks Paul DBrown for helping
Can you show a depiction of the expected outcome? The DAX is simple, as in:
Current week = WEEKNUM(TODAY())
The question is how you wsih to protray this in the visual
- icturion4 years ago
Resolver II
Hello PaulDBrown,
thank you for the quick respons. i use a calculated column with this dax formule
Current Week = IF(Kalender[WeekNumber] = WEEKNUM(TODAY()), "Current", CONVERT(Kalender[WeekNumber],STRING))But the current week out come is wrong, i now return week 42 as current, but the correct week is 41do you know how to resolve this?- PaulDBrown4 years ago
Community Champion
If you use a calculated column, the data will only be updated on refresh. A measure will be refreshed whenever the measure is used.
You also need to be aware of how the week numbers are counted. The expression WEEKNUM(TODAY()) will count weeks based on:
"The week containing January 1 is the first week of the year and is numbered week 1."The expression WEEKNUM (TODAY(), 2) will count weeks based on:
"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."Refer to
https://docs.microsoft.com/en-us/dax/weeknum-function-dax
- icturion4 years ago
Resolver II
The problem is resolved.
this is the solution
Current Week = IF(Kalender[WeekNumber] = WEEKNUM(TODAY(),21), "Current", CONVERT(Kalender[WeekNumber],STRING))thanks Paul DBrown for helping