cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
pauldamen New Member
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

Accepted Solutions
tringuyenminh92 New Contributor
New Contributor

Re: Get date from full number

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.
1 REPLY 1
tringuyenminh92 New Contributor
New Contributor

Re: Get date from full number

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
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

PBI Community Highlights

PBI Community Highlights

Check out what's new in the Power BI Community!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 6 members 3,065 guests
Please welcome our newest community members: