This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi team,
I have a date in the 2017-01-01 format. I wanted to convert it into 201701 (week number 1 of the year 2017)
I have used the formula
Week Number = YEAR( Calendar(date) ) & WEEK( Calendar(date) )
and the result I get is 20171
I need it to be exactly 201701. How should I procceed?
Solved! Go to Solution.
I'd do it in this manner.
Week Number =
INT (
CONCATENATE (
YEAR ( 'Calendar'[Date] ),
FORMAT ( WEEKNUM ('Calendar'[Date] ), "00" )
)
)
I'd do it in this manner.
Week Number =
INT (
CONCATENATE (
YEAR ( 'Calendar'[Date] ),
FORMAT ( WEEKNUM ('Calendar'[Date] ), "00" )
)
)
wow, apparently there were tons of options for this scenario. Thank you everyone for your help. This option ended up being the most complete and yet simple
Let's keep it going! 😄
YearMo = YEAR(Calendar(Date)) & RIGHT("0" & WEEK(Calendar(date)), 2)
@konstantinosIts good to see you back on here ![]()
@ChihiroI should have thought of that shortcut - I like it ![]()
I actually use something similar for a Month Order Column
Month Order = VALUE ( FORMAT ( 'Calendar'[Date], "YYYYMM" ) )
@AnonymousI believe you were in a hurry to post... ![]()
Week Number =
INT (
YEAR ( 'Calendar'[Date] )
& RIGHT ( "0" & WEEKNUM ( 'Calendar'[Date] ), 2 )
) @jfernand Take your pick! ![]()
Here is a simplier one
Week Number = YEAR(Calendar(date)) & FORMAT(WEEK(Calendar(date)), "00")
=FORMAT(Calendar[Date], "YYYYMM")
This should work... ![]()
Week Number =
INT (
CONCATENATE (
YEAR ( 'Calendar'[Date] ),
CONCATENATE (
IF ( WEEKNUM ( 'Calendar'[Date] ) < 10, "0", "" ),
WEEKNUM ( 'Calendar'[Date] )
)
)
)
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 32 | |
| 23 | |
| 22 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 64 | |
| 41 | |
| 27 | |
| 22 | |
| 20 |