Forum Discussion
Convert date into YEAR-Week
- 6 years ago
Hi RonaldvdH
Create a caluclated column
Column = IF(WEEKNUM([Date])<10,FORMAT([Date],"YYYY-0WW"),FORMAT([Date],"YYYY-WW"))
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi RonaldvdH
Create a caluclated column
Column = IF(WEEKNUM([Date])<10,FORMAT([Date],"YYYY-0WW"),FORMAT([Date],"YYYY-WW"))
Maggie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous4 years agoNot applicable
v-jutoma Is there a way to make the above a date so that it can be formatted as a custom date in the modeling area? Then you can make it continuous on the X axis rather than categorical.
- RonaldvdH6 years agoPost Patron
v-juanli-msft that did the trick, thank you :)
- saviola076 years agoFrequent Visitor
Hi Maggie,
I used your method and I thought it worked as a charm, but for some reason it uses the American week (so starts on Sunday).
I tried to amend the formula to this:
IF(WEEKNUM('Calendar'[Date];2)<10;FORMAT([Date];"YYYY-0WW");FORMAT('Calendar'[Date];"YYYY-WW"))But I somehow needs to change the format of the "YYYY-WW" but absolutely no idea on how to do that!?- GadeshevArman3 years agoNew Member
Hi saviola07, v-juanli-msft ,
Is there any solution for this issue? Created column with this:
OrderWeekYear = IF(WEEKNUM([Order Date],21)<10,FORMAT([Order Date],"YYYY-0WW"),FORMAT([Order Date],"YYYY-WW"))Same result needed, graphic shows that 1st January of 2023 is 1st week of 2023.
Corect result should be 52nd week of 2022.
Thanks in advance.
- Schwurblini3 years agoFrequent Visitor
Hey,
I created something like this:
Weeks = WEEKNUM([Date],21) & "." & FORMAT([Date], "YYYY")Output:52.202252.20221.20231.2023and so on, it will initially be a text, but can be formated to a numberDoes this help?