Forum Discussion

mtrevisiol's avatar
mtrevisiol
Helper V
4 years ago

M code for a DAX expression

Hi everyone,

I need to transform this DAX expression in M:

 

Week= YEAR(Calendar[Date]+26-WEEKNUM(Calendar[Date],21)) & "-" & IF(WEEKNUM(Calendar[Date],21)>=10, WEEKNUM(Calendar[Date],21), "0" & WEEKNUM(Calendar[Date],21))
 
which calculates the week of the year followed by the year for each date of my calendar, according to the European system:
 

 

 

Can you help me? Many thanks!