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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors