• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Convert Dates

Dear Chandoo fans :)

I'm almost going to the bridge and throw myself to the river... :s

I have some .csv files with dates. When exported to powerbi, i can't have the dates ok, probably because of the format. They are with "mm/dd/yyyy" and I need to convert them to "dd/mm/yyyy".

Someone can help me with this?

I just can't do it.

I promise I won't go to the bridge :D

Thank you
 
Hi,

You can edit your query and Go to File > Options and Settings > Regional Settings > Local (for changing Regional Setting) follow below screenshot.

Meanwhile "Stay Home, Stay Safe" :)

Regards,
 

Attachments

  • Regional Setting.png
    Regional Setting.png
    29.9 KB · Views: 2
I'd not change region setting, as that will impact every file that is read via PowerQuery/PowerBi.

Instead, once the data is imported, go into query editor. Click on left corner of the column and find "Using Locale...".
This will allow you to specify the culture/locale of the source file and handle it in M-Code.
Ex: To import English (US) based source into UK based system.
Code:
 =Table.TransformColumnTypes(#"Pervious Step Name", {{"DateColumnName", type datetime}}, "en-US")
 
Back
Top