cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Bergh Visitor
Visitor

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

Accepted Solutions
Community Support Team
Community Support Team

Re: Whole number in to yyyy,mm,w

@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
Super User
Super User

Re: Whole number in to yyyy,mm,w

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 a Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
Community Support Team
Community Support Team

Re: Whole number in to yyyy,mm,w

@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

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 347 members 3,138 guests
Please welcome our newest community members: