Forum Discussion
Transform a date to year-month
- 9 years ago
- 9 years ago
RvdHeijdenHere's DAX
Year-Wk = YEAR ( 'Calendar'[Date] ) & "-" & CONCATENATE ( IF ( WEEKNUM ( 'Calendar'[Date] ) < 10, "0", "" ), WEEKNUM ( 'Calendar'[Date] ) )Yes you may have to adjust WEEKNUM depending on when your week starts SUN (1) on MON (2)
I have skipped this optional parameter because the default is 1 which is what i need.
Hope this helps.
Good Luck!:smileyhappy:
RvdHeijdenHere's DAX
Year-Wk =
YEAR ( 'Calendar'[Date] ) & "-"
& CONCATENATE (
IF ( WEEKNUM ( 'Calendar'[Date] ) < 10, "0", "" ),
WEEKNUM ( 'Calendar'[Date] )
)
Yes you may have to adjust WEEKNUM depending on when your week starts SUN (1) on MON (2)
I have skipped this optional parameter because the default is 1 which is what i need.
Hope this helps.
Good Luck!:smileyhappy:
Wow....thanks again Sean that did the trick :smileyhappy:
- MarcelBeug9 years ago
Community Champion
Sorry, but I'm afraid not. Probably the DAX week number does NOT return the ISO Week number (unless I'm terribly mistaking as I'm not a DAX expert).
- MarcelBeug9 years ago
Community Champion
It seems that you can supply 21 as second parameter to the WEEKNUM Function to obtain the ISO Week Number, see comments below Microsofts documenetation.