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

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

Reply
Orstenpowers
Post Patron
Post Patron

Problems with illustration of Year-Calendar week

Dear all,

 

I am using 

 
YEAR-CW = FORMAT('Date'[Date],"YYYY") & "-" & WEEKNUM('Date'[Date],21)
 
to illustrate Year-calendar week.
This works quite fine, but what do I need to do in order to get 2024-01, 2024-02 instead of 2024-1, 2024-2...?
So, for the weeks 1-9 I would like to have an additional 0.
 
How do I need to adjust my measure??? Any idea?
 
 
1 ACCEPTED SOLUTION

Wrap weeknumber inside format

 

format(WEEKNUM('Date'[Date],21),"00")
 


* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

View solution in original post

2 REPLIES 2
Ahmedx
Super User
Super User

YEAR-CW = FORMAT('Date'[Date],"YYYY") & "-" & FORMAT(WEEKNUM('Date'[Date],21),"00")

Wrap weeknumber inside format

 

format(WEEKNUM('Date'[Date],21),"00")
 


* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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