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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
joshcomputer1
Helper V
Helper V

formatting week number in data table

I have a date table and am trying to get the week number to output two digits every time. I currently have the formula below, but the output will just have one digit if the week number is a single digit i.e. it will show 1 instead of 01.  This gets the sorting out of order. I want the output to get two digits everytime. 

 

Date =
ADDCOLUMNS (
CALENDAR (date(2017, 1,1), date(2018,12,31)),

"Year", YEAR ( [date] ),
"QuarterOfYear", FORMAT ( [Date], "Q" ),
"MonthOfYear", FORMAT ( [Date], "MM" ),
"DateInt", FORMAT ( [Date], "YYYYMMDD" ),
"MonthName", FORMAT ( [Date], "mmmm" ),
"MonthYear", FORMAT ( [Date], "mmm YY"),
"QuarterInCalendar", "Q" & FORMAT ( [Date], "Q" ) & " " & FORMAT ( [Date], "YYYY" ),
"WeekNum", FORMAT( [date], "ww/YYYY" ),
"YearWeekNum", Format ( [date], "YYYY/ww"),
"DayInWeek", WEEKDAY ( [Date] ),
"DayOfWeekName", FORMAT ( [Date], "dddd" ),
"DayOfWeekShort", FORMAT ( [Date], "ddd" ),
"YearMonthShort", FORMAT ( [Date], "YYYY mm" ),
"MonthNameShort", FORMAT ( [Date], "mmm" ))

1 ACCEPTED SOLUTION
CristinaLia
Frequent Visitor

Hi @joshcomputer1,

 

Try this ?

 

"WeekNum",FORMAT(WEEKNUM([date],2),"00")& "/" & FORMAT ( [Date], "YYYY" ), 

Regards,

 

Cristina

View solution in original post

1 REPLY 1
CristinaLia
Frequent Visitor

Hi @joshcomputer1,

 

Try this ?

 

"WeekNum",FORMAT(WEEKNUM([date],2),"00")& "/" & FORMAT ( [Date], "YYYY" ), 

Regards,

 

Cristina

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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