cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Marcjc Frequent Visitor
Frequent Visitor

Text to Time - different text format

I know that there are a lot of text / time conversion discussions on the site, but none of them seem to fit my situation. I am hoping someone may be able to assist me with how I can convert the following examples from text to time. The ultamite goal I have is to be able to count rows based on a filter that have a 'time less than 4 hours', 'time less than 24 hours', and then 'time greater than 24 hours'. My first step was to be able to convert the column containing these values to Time, but when I try, Power Bi throws a message that it cannot convert the column. 

 

A few text field examples:

 

9 minutes

34 minutes

12 seconds

1 day 12 minutes

11 hours 3 minutes

 

Any assistance would be appreciated.

 

Thank you!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator v-yuezhe-msft
Moderator

Re: Text to Time - different text format

@Marcjc,

Please check if the Power Query code in the following PBIX file returns your expected result.

https://1drv.ms/u/s!AhsotbnGu1Nok3aBo-5kuXIjmgz_

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
rajendran Super Contributor
Super Contributor

Re: Text to Time - different text format

How do you want to display "9 mins" or " 1 hr 22 mins" ?

 

Thansk
Raj

Marcjc Frequent Visitor
Frequent Visitor

Re: Text to Time - different text format

Thank you for the quick reply... I am not really worried about how the time is displayed in the converted column in the table because the ultimate goal is to present a single number (count) of the rows that fit the filter criteria. 

Marcjc Frequent Visitor
Frequent Visitor

Re: Text to Time - different text format

Sample data for review. 

 

PowerBI-Sample-2.PNG

 

 

Moderator v-yuezhe-msft
Moderator

Re: Text to Time - different text format

@Marcjc,

Please check if the Power Query code in the following PBIX file returns your expected result.

https://1drv.ms/u/s!AhsotbnGu1Nok3aBo-5kuXIjmgz_

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Marcjc Frequent Visitor
Frequent Visitor

Re: Text to Time - different text format

@v-yuezhe-msft,

 

Thank you. I was able to use this. I ended up adding the seconds conversion to my filter and then used advanced filtering for less than or greater than my requirements. Thank you for this! I have marked it as the solution. 

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 141 members 1,515 guests
Please welcome our newest community members: