Power Query change date format to dd/mm/yyyy

Power Query change date format to dd/mm/yyyy

I get this below, which makes me wonder if the formula returns the format defined by the operating system in the regional settings.

Power Query change date format to dd/mm/yyyy

Why do you need it converted to that format mm/dd/yyyy inside PQ? This can be done when the data is loaded in Excel.

EDIT:

Date.ToText(date, "mm/dd/yyyy")

allows to force the formats, but the date is then text. Not sure you want that.

Last edited: Aug 18, 2021

Power Query change date format to dd/mm/yyyy

Thanks. The data/table that is created is moved to a Template that is used to upload information into another software program. Thats the program that needs the date in a specific format. I tried to change the format on the excel tab / table but that didn't work when I tried to push the data to the other Software. just for clarity, where I created the new column I should change the formula from: = =DateTime.LocalNow() to: Date.ToText(date, "mm/dd/yyyy") Sorry, relatively new to Excel Power Query.

I really appreciate your help

Power Query change date format to dd/mm/yyyy

I see, so the actual value matters, not simply the format. Seems then it must be text.
I meant like this

=Date.ToText(Date.From(DateTime.LocalNow()), "mm/dd/yyyy")

Power Query change date format to dd/mm/yyyy

= Table.AddColumn(#"Added Custom Resource", "Created", each Date.ToText(Date.From(DateTime.LocalNow()), "mm/dd/yyyy")) In the applied steps (adding a new column under the formula, I added this: =Date.ToText(Date.From(DateTime.LocalNow()), "mm/dd/yyyy") But this formula is resulting in a value of 00/18/2021 it should be 08/18/2021 Not sure what I did wrong.

Thanks

Power Query change date format to dd/mm/yyyy

OK I changed it to: = Table.AddColumn(#"Added Custom Resource", "Created", each Date.ToText(Date.From(DateTime.LocalNow()), "MM/dd/yyyy")) capitalizing the MM made a difference

THANK YOU FOR YOUR HELP

Power Query change date format to dd/mm/yyyy

Most welcome. Thanks for the feedback. Never thought "MM" makes such difference. Learned from this too. ?

Power Query change date format to dd/mm/yyyy

Thanks for the Intel, that's good to know. Strangely enough, it seemed to work on my end with just mm not MM.
Need to look into it some more.

Sometimes the formatting will not workout. Create a new formula column. Use left, right and mid function and make it as mm/dd/yyyy date and mark that column as date as well as sort column for the dd/mm/yyyy column.

mid(DD__MM__YY[Date],4,2) &"/"& left(DD__MM__YY[Date],2) & "/" & right(DD__MM__YY[Date],4)

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @ Thanks.

My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601