Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MurVeman
Frequent Visitor

Week number must display 2 digits(e.g. 01 not 1 )

Hi All,

 

I wanted to see week number in two digits not in single digit(e.g. 01 not 1), please help me with fixing the below formula. Thanks in advance.

 

Dax Formula - 

Week_Number (Overall changed on timestamp) =
"CW " &
YEAR('TestEecution (2)'[Overall Changed On Text]) &
"-" &
WEEKNUM(
'TestEecution (2)'[Overall Changed On Text]
)

 

Current results for the above formula - 

MurVeman_0-1705321480288.png

 

Thanks & Regards,

Murali

1 ACCEPTED SOLUTION

Simply do this:
Week_Number (Overall changed on timestamp) =
"CW " &
YEAR('TestEecution (2)'[Overall Changed On Text]) &
"-" &
FORMAT(WEEKNUM(
'TestEecution (2)'[Overall Changed On Text]
),"00")

Kudos and mark as solution appreciated 

zenisekd_0-1705390205441.png

 

View solution in original post

6 REPLIES 6
FREDPI
Frequent Visitor

You can also add a zero to the weeknumber and then take the right(2,weeknumber) in the formula.

 

This will give you the answer you are looking for.

the week number is coming from the data column "Overall changed on text"

zenisekd
Super User
Super User

Please refer to the following formula:
zenisekd_0-1705321772907.png

 

That week number is coming from the date

Simply do this:
Week_Number (Overall changed on timestamp) =
"CW " &
YEAR('TestEecution (2)'[Overall Changed On Text]) &
"-" &
FORMAT(WEEKNUM(
'TestEecution (2)'[Overall Changed On Text]
),"00")

Kudos and mark as solution appreciated 

zenisekd_0-1705390205441.png

 

thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.