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
pauldamen
New Member

Get date from full number

Hi,

 

I am pretty new to PowerBI. I have a colum with a year month date in it which looks like this: 201612 (december 2016). How can I get a recognized date from this?

 

Regards, Paul

1 ACCEPTED SOLUTION
tringuyenminh92
Memorable Member
Memorable Member

Hi @pauldamen,

It could not be recognized as date type, you need to add one custom column based on this column.
If this is int column (201612), you could use date method: new column= date(divide(yearmonthcolumn,100),mod(yearmonthcolumn,100),1) and choose this column data type is date type.
If this is string column, you could: new column = date(value(left(yearmonthcolumn,4)),value(right(yearmonthcolumn,2)), 1)
And choose this column data type to date type.

View solution in original post

1 REPLY 1
tringuyenminh92
Memorable Member
Memorable Member

Hi @pauldamen,

It could not be recognized as date type, you need to add one custom column based on this column.
If this is int column (201612), you could use date method: new column= date(divide(yearmonthcolumn,100),mod(yearmonthcolumn,100),1) and choose this column data type is date type.
If this is string column, you could: new column = date(value(left(yearmonthcolumn,4)),value(right(yearmonthcolumn,2)), 1)
And choose this column data type to date type.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.