cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dsandip59 Member
Member

How to create date from 201902 to 02/01/2019 using dax or power query?

Hi,

I have date column and the value of the column is : 201902 which is YYYYMM format. when I load the value in power bi, it shows that data type is shoowing as Text.

Now I have to create date from this and format should be MM/DD/YYYY.

 

Please suggest what to do now?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: How to create date from 201902 to 02/01/2019 using dax or power query?

Hi @dsandip59 

You can add custom column in query editor.

Please see the code below

=Date.FromText([YourColumn] & "01")

Regards,
Mariusz

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
cnweke Member
Member

Re: How to create date from 201902 to 02/01/2019 using dax or power query?

https://docs.microsoft.com/en-us/dax/datevalue-function-dax

 

The datevalue(DateColumn) should work here. It turns text based date into datetime values. 

Super User
Super User

Re: How to create date from 201902 to 02/01/2019 using dax or power query?

Hi @dsandip59 

You can add custom column in query editor.

Please see the code below

=Date.FromText([YourColumn] & "01")

Regards,
Mariusz

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
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and 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.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 129 members 1,583 guests
Please welcome our newest community members: