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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SHAKEDALROY
Helper I
Helper I

CONVERT DATA TYPE TEXT TO TIME

HI

I have a text column in an existing table. I want to remove the seconds so that it will relate to a Time table column that is in hh:mm format (with am/pm) . I know this is likely easy, but I cannot figure out the m code in order to do this. Help will be greatly appreciated.

 
 

TT

1 ACCEPTED SOLUTION
Payeras_BI
Super User
Super User

Hi @SHAKEDALROY ,

 

On your Violation time column:

1. Replace values --> A by AM and P by PM

2. Split the column in 3 by Number of Characters (2) with the option "Repeatedly"

3. Combine the two first columns with a ":" as separator

4. Combine the resulting column with the one left containing AM/PM with a space as separator

5. In your Ribbon > Transform > Date & Time Column > Hour > Analize

 

Regards


 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

View solution in original post

2 REPLIES 2
Payeras_BI
Super User
Super User

Hi @SHAKEDALROY ,

 

On your Violation time column:

1. Replace values --> A by AM and P by PM

2. Split the column in 3 by Number of Characters (2) with the option "Repeatedly"

3. Combine the two first columns with a ":" as separator

4. Combine the resulting column with the one left containing AM/PM with a space as separator

5. In your Ribbon > Transform > Date & Time Column > Hour > Analize

 

Regards


 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

Thank you @Payeras_BI  appreciate the quick response🌻

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors