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
Smartnag
Frequent Visitor

Date & time format change in power query

Hi All,

 

I am getting the date from the source in below format, i want date & time should be in MM/DD/YYYY HH:MM:SS AM/PM.

20140706 17:23

 

How do i change in Power Query.

 

Thanks,

Smartnag

2 REPLIES 2
erothen
Frequent Visitor

You'll need to use the DateTime.ToText function. 

Function documentation- https://learn.microsoft.com/en-us/powerquery-m/datetime-totext

Format specifiers- https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings

 

Example that should work for you depending on current culture (if this doesn't work, add a specified format [Format="x", Culture="y"])-

 

Usage

DateTime.ToText(#datetime(2010, 12, 31, 01, 30, 25))

Output

"12/31/2010 1:30:25 AM"

 

Thanks for the reply, i tried in both the ways.

 

got the below errors.

 

And the date time  is  coming from the source is text format.

20160821 09:15

 

Smartnag_0-1663599364433.pngSmartnag_1-1663599374621.pngSmartnag_2-1663599403382.png

Smartnag_3-1663599412180.png

 

Thanks,

Smartnag

 

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.