cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

## Week number with 2 digits

Hi,

The weeknum formula returns the weeks 1 to 9 as single digits. Is there a way to display these as 2 digits, e.g. 01, 02....09?

Thanks!

1 ACCEPTED SOLUTION

Looks like I've managed to solve this myself

I used the DAX Formula " weeknumber = FORMAT(WEEKNUM([date],1),"00")  "

If anyone has any other better solutions, please feel free to contribute.

4 REPLIES 4

Looks like I've managed to solve this myself

I used the DAX Formula " weeknumber = FORMAT(WEEKNUM([date],1),"00")  "

If anyone has any other better solutions, please feel free to contribute.

Anonymous
Not applicable

If your week numbers are stored as whole numbers, then:

format(if(WEEKNUM([date]<10,CONCATENATE(0,WEEKNUM([date]),WEEKNUM([date]),00)

that is,

format (<value>, <format_string>) where

<value> = if(WEEKNUM([date]<10,CONCATENATE(0,WEEKNUM([date]),WEEKNUM([date]

and

<format_string> = 00

@afk wrote:

Looks like I've managed to solve this myself

I used the DAX Formula " weeknumber = FORMAT(WEEKNUM([date],1),"00")  "

If anyone has any other better solutions, please feel free to contribute.

Frequent Visitor

date = FORMAT(DATE(LEFT([Year-Month],4),RIGHT([Year-Month],2),1),"yyyy-mm")

Resolver IV

hi, @afk

This is correct.

But you could do this directly in POWER QUERY, with a similar formula, removing the calculation from the tip.
Or use a CALENDAR table for this and standardize the dates of your dashboard.

Best Regards,
Rfranca

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Power BI Monthly Update - May 2024

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

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors