cancel
Showing results for 
Search instead for 
Did you mean: 
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 I
Super User I

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 I
Super User I

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

Thank you @Payeras_BI  appreciate the quick response🌻

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors