Forum Discussion

sudeng123's avatar
sudeng123
Icon for Microsoft Employee rankMicrosoft Employee
5 years ago
Solved

manipulation of the dax function Weeknum

so i manually made the column year and week by using year and weeknum dax, but a problem came up where when i sort this column asc, it thinks FY2012-W10 is before FY2012-W6 because 1 comes before 6, is there a way for me to manipulate the weeknum dax to do 01 instead of just 1? also i cannot use power query right now and i cannot sort this column by another column because every other column has duplicate data in it, when i tried that it just throws me an error.

 

any help would be appreciated.

 

  • You can use a custom format string, or make a column with an expression like this.

     

    FYWW = "FY" & FORMAT('Date'[Date], "yyyy") & "WK" & FORMAT(WEEKNUM('Date'[Date],1), "00")
     
    Regards,
    Pat

2 Replies

  • mahoneypat's avatar
    mahoneypat
    Icon for Microsoft Employee rankMicrosoft Employee

    You can use a custom format string, or make a column with an expression like this.

     

    FYWW = "FY" & FORMAT('Date'[Date], "yyyy") & "WK" & FORMAT(WEEKNUM('Date'[Date],1), "00")
     
    Regards,
    Pat