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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
krishna_murthy
Helper II
Helper II

how to convert time format on 2025-06-30 15:15:46.745000

Hi Team,

 

Requesting please check and provide the time format.

source sourace of data.

2025-06-30 15:15:46.745000

 

Required out like this ----6/30/2025 3:12:36 PM---

 

i have connected though direct query please check and share the details 

 

3 ACCEPTED SOLUTIONS
NumaData
Helper I
Helper I

Hi Krishna, 

In Power Query, select the Add Column Tab and select Custom Column. Here you can name a new Date Column and enter the M Code - 
= DateTime.ToText([YourColumnName], "M/d/yyyy h:mm:ss tt")

Let me know how you get along 🙂

~ Numa

View solution in original post

Praful_Potphode
Super User
Super User

Hi @krishna_murthy ,

 

since it is directquery i will agree with @grazitti_sapna  and suggest the same.

Another option to handle this could be in the query itself.

when you are connecting  the table through Directquery, apply the inbuilt sql functions to convert it into the format you want.this will push the transformation to the source database making report faster.

 

Please give kudos or mark it as resolved once confirmed.

 

Thanks and Regards,

Praful

View solution in original post

v-pgoloju
Community Support
Community Support

Hi @krishna_murthy,

 

Just following up to see if the Response provided by community members were helpful in addressing the issue. if the issue still persists Feel free to reach out if you need any further clarification or assistance.

 

Best regards,
Prasanna Kumar

View solution in original post

6 REPLIES 6
v-pgoloju
Community Support
Community Support

Hi @krishna_murthy,

 

Just following up to see if the Response provided by community members were helpful in addressing the issue. if the issue still persists Feel free to reach out if you need any further clarification or assistance.

 

Best regards,
Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @krishna_murthy ,

 

Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to @Praful_Potphode , @grazitti_sapna , @NumaData and @rohit1991  for prompt and helpful responses.

 

Just following up to see if the Response provided by community members were helpful in addressing the issue. if the issue still persists Feel free to reach out if you need any further clarification or assistance.

 

Best regards,
Prasanna Kumar

 

Praful_Potphode
Super User
Super User

Hi @krishna_murthy ,

 

since it is directquery i will agree with @grazitti_sapna  and suggest the same.

Another option to handle this could be in the query itself.

when you are connecting  the table through Directquery, apply the inbuilt sql functions to convert it into the format you want.this will push the transformation to the source database making report faster.

 

Please give kudos or mark it as resolved once confirmed.

 

Thanks and Regards,

Praful

grazitti_sapna
Super User
Super User

Hi   @krishna_murthy 

 

To convert a datetime value like 2025-06-30 15:15:46.745000 to the format 6/30/2025 3:12:36 PM in Power BI using DirectQuery, you should use the DAX FORMAT function to create a calculated column.

 

FormattedDateTime = FORMAT('YourTable'[DateTimeColumn], "m/d/yyyy h:mm:ss AM/PM")

Note: 

  • Replace 'YourTable' with the actual name of your table and [DateTimeColumn] with the name of your datetime column containing values like 2025-06-30 15:15:46.745000.
  • FORMAT function returns a text result, so this column cannot be used for chronological sorting or numeric calculations. It is intended purely for display purposes in visuals.
  • If you need to sort by this date, keep the original datetime column and use it in sorting, while displaying the formatted version in visuals.

    Alternative approach: Custom Formatting in Visual Level

    1. Select the visual using the datetime field.
    2. In the Visualizations pane, expand the field well.
    3. Click the dropdown next to the datetime field and select Format.
    4. Choose a custom format like m/d/yyyy h:mm:ss AM/PM.

This method keeps the underlying data type as datetime, preserving sortability and filtering capabilities while changing only the display format.

 

🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.

💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.

🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.

🔗 Curious to explore more? [Discover here].

Let’s keep building smarter solutions together!

 

 

NumaData
Helper I
Helper I

Hi Krishna, 

In Power Query, select the Add Column Tab and select Custom Column. Here you can name a new Date Column and enter the M Code - 
= DateTime.ToText([YourColumnName], "M/d/yyyy h:mm:ss tt")

Let me know how you get along 🙂

~ Numa

rohit1991
Super User
Super User

Hi @krishna_murthy 

1. In Power Query (M Language)

If your column name is DateTimeColumn:

= Table.TransformColumns(
   Source,
  {{"DateTimeColumn", each DateTime.ToText(_, "M/d/yyyy h:mm:ss tt"), type text}}
)

Converts to 12-hour format with AM/PM.

 

2. In DAX (Calculated Column or Measure)

If your column is [DateTimeColumn]:

Formatted Time =
FORMAT ( [DateTimeColumn], "M/d/yyyy h:mm:ss AM/PM" )


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.