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
Highlighted
Super User IV
Super User IV

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. 

Highlighted
Super User IV
Super User IV

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
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors