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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Bergh
Helper II
Helper II

Whole number in to yyyy,mm,w

Hi I have a problem to convert whole number to date. The numbers are like this: yyyymmweek

How can I do??

 2019-07-02_08-59-49.jpg

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@Bergh ,

 

As Matt mentioned, the we can't determine the day in a week, so you can only convert the number to date(Year/Month) and week seperately.

 

Besides spliting the column, you can also create custom columns using M code below:

YearMonth = Text.Start(Text.From([Date]), 4) & "/" & Text.Middle(Text.From([Date]), 4, 2)

Week = Text.End(Text.From([Date]), 1)

Capture.PNG 

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

@Bergh ,

 

As Matt mentioned, the we can't determine the day in a week, so you can only convert the number to date(Year/Month) and week seperately.

 

Besides spliting the column, you can also create custom columns using M code below:

YearMonth = Text.Start(Text.From([Date]), 4) & "/" & Text.Middle(Text.From([Date]), 4, 2)

Week = Text.End(Text.From([Date]), 1)

Capture.PNG 

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Well, if you had yyyymmdd i would say go into power query, split the column into 3, yyyy, Mm, dd and then merge again in the format dd-mm-yyyy. Then convert to a date. But I have no idea how to turn your week number into a date. I guess you will need to do it in Excel manually. 



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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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