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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

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
Anonymous
Not applicable

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

Thanks and Regards,
Praful Potphode
LinkedIn-https://www.linkedin.com/in/praful-p-912349241/

View solution in original post

Anonymous
Not applicable

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
Anonymous
Not applicable

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

Anonymous
Not applicable

Hi @krishna_murthy ,

 

Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to @Praful_Potphode , @grazitti_sapna , @Anonymous 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

Thanks and Regards,
Praful Potphode
LinkedIn-https://www.linkedin.com/in/praful-p-912349241/
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!

 

 

Anonymous
Not applicable

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

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.