Forum

Date format change ...
 
Notifications
Clear all

Date format change in Editor

4 Posts
2 Users
0 Reactions
69 Views
(@nd09689)
Posts: 23
Trusted Member
Topic starter
 

HI,  I would like my data format to turn out to be "MM/DD/YYYY"  or "DD/MM/YYYY" however when it is loaded into power query, it turns out as follows

dateformat.PNG

The first data should be June 1st 2019. The last two digits from right should be year "2019" . should I use the Extract function to extract the right two digits and make a custom column for year, then extract middle section and so forth? But since all my data are like this is there a way to create a new data function for this type that I can use repeatedly when this format comes in?

 
Posted : 11/06/2019 1:46 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Junko,

You could use the Text.Start, Text.Middle and Text.End functions to extract the date elements and then join them back together as a date. You can see the different Power Query text functions here.

You can then copy this formula as required.

Mynda

 
Posted : 11/06/2019 6:58 am
(@nd09689)
Posts: 23
Trusted Member
Topic starter
 

HI  thanks for your tip. I was able to customize the date. (attachment 1) Nevertheless, is there a way to make this a function? so I can apply this to other dates that require date change. (i.e. credit date, delivery date etc)

 

custom_date_column.PNG

 
Posted : 12/06/2019 2:56 am
(@mynda)
Posts: 4761
Member Admin
 

Well you can (see the session 7 on custom functions), but functions aren't really any more transferable from one query to the next than the custom column formula. I'd just save the formula in a text file for use in other queries.

Mynda

 
Posted : 12/06/2019 7:52 am
Share: