Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
RafaelKnuth
Advocate I
Advocate I

M-Language: How to convert date format from European to US?

I was wondering how to write a function in M that would convert date formats from EU to US?

Example: December 31st, 2010 needs to be transformed from 31/12/2010 to 12/31/2010

 

DateEU.PNG

 

Below an exemplary Excel function - I was wondering if I can perform that date transformation with M in my Power Query?

 

DateFormat.PNG

 

I went through the Power Query M Function reference, but I couldn't find a function that allows me to reverse a value in any desired order (I only found one function that allows me to reverse in one specific order: 1234 would become 4321 but that's not the solutiuon I want).

As a temporary workaround, I would split the Date EU column into 3 columns by the slash delimiter, and then merge those columns in reversed order. But that's a very creepy, unelegant solution IMHO.

 

Any ideas? Thanks a lot in advance!

2 REPLIES 2
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @RafaelKnuth,

 

You can try Date.ToText function.

=Date.ToText([date],"MM/dd/yyyy")

1.PNG

 

Besides, you can try to convert date using Local.

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Yuliana,

thanks for your help!

It partially worked - the solution you suggested didn't work on my computer (I tried different variations), Reza's solution did work, but only in one specific case. To me it seems that proper date conversion depends on multiple factors (such as Locale settings). That's a tricky one 😉 There are so many odd date formats people are using.

Best,

Rafael

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.