Forum Discussion

Anika3186's avatar
Anika3186
Frequent Visitor
5 years ago
Solved

change number format in query editor

Hello, I have a column ("calendar week) with numbers from 1-53 (the column is formatted as Integer). Now I want to put a 0 in front of the numbers 1-9 (=> 01,02,03, etc).   Can someone help me and...
  • mahoneypat's avatar
    5 years ago

    Please try this approach in a DAX column, using your table/column names.

     

    NewWeekNum = FORMAT(WEEKNUM('Date'[Date]), "00")
     
    Or you can do it in the query editor with this formula in a custom column
     
    = Text.PadStart(Text.From(Date.WeekOfYear([DateColumn])), 2, "0")
     
    Regards,
    Pat