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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.