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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

changing data type

Hello,

 

Im new to Power BI and im kinda stuck while changing data type from text to duration. When I change the data type it gives me this error: "expression.error can not parse the literal duration value". 

 

My goal is to filter the duration to be able to make a visualization of the tickets which have more than 2 hours of working time.

 

Please help, thanks!

1 ACCEPTED SOLUTION

hi, @Anonymous

You may try this way:

Select t_time column, duplicate the column, then split the duplicate column

12.JPG

Then filter column t_time - Copy.1 who is greater than 2

13.JPG

 

Best Regards,

Lin

 

 

 

Community Support Team _ Lin
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

16 REPLIES 16
v-lili6-msft
Community Support
Community Support

hi, @Anonymous

You could refer to this post:

https://community.powerbi.com/t5/Desktop/Purpose-of-quot-Duration-quot-datatype-in-Power-Query/td-p/237275

Before this, you should change data type from text to date time.

 

If not your case, Please share your sampe pbix or some data sample and the formula and expected output. You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading

 

 

Best Regards,

Lin

 

 

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

Are you trying to do this in DAX or Power Query?

 

Can you post an example of the data? Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

That being said, check out these links:

https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486

https://community.powerbi.com/t5/Quick-Measures-Gallery/Milliseconds-Duration/m-p/406698



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi can u check my latest reply, I have posted a picture which shows what error I get. I checked ur links but cant fix this issue with it because it contains values greater than 24 hours.

hi, @Anonymous

Can you post an example of the data?  from the screenshot, we couldn't get other details.

 

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Best Regards,

Lin

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

Something like this?

I have selected the time value which is causing the problem.

 Sample data.png

hi, @Anonymous

 

Power bi not support duration type, I'd like to suggest you convert it as total second or other similar numeric value to calculate.
You can also take a look at below blog to know how to handle with duration in power bi:

Aggregating Duration/Time

What is your expected output in power bi(not power query )? maybe we could help you get your expected output by DAX.

 

Best Regards,

Lin

 

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

I want to filter the tickets in Power BI who have a time of 2 hours +

hi, @Anonymous

You may try this way:

Select t_time column, duplicate the column, then split the duplicate column

12.JPG

Then filter column t_time - Copy.1 who is greater than 2

13.JPG

 

Best Regards,

Lin

 

 

 

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

Thanks this works but what if a new value is added in the t_time column, will it be automatically split in the other columns wich I made?

hi, @Anonymous

Yes, it will be automatically split into the other columns when you refresh data.

https://docs.microsoft.com/en-us/power-bi/refresh-desktop-file-local-drive

https://docs.microsoft.com/en-us/power-bi/refresh-scheduled-refresh

 

Best Regards,

Lin

 

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

okay, Smiley Happy one last question. What if I publish it and make a dashboard with those details. Will the new data that is added automatically be synced and divided into these columns? 

hi, @Anonymous

Yes, the new data that is added automatically will be synced and divided into these columns.

Of course, you need to learn about how to set refresh.Smiley Happy

 

Best Regards,

Lin

 

 

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

okay thank you very much for your help

Anonymous
Not applicable

I am trying to do this in power query, the thing is that currently, the data type for the duration is text. But I want to make a schema with a filter which shows just certain durations. 

hi, @Anonymous

Please share your sampe pbix or some data sample and the formula and expected output.

It will be helpful for us to solve this case.

 

Best Regards,

Lin

 

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

It happens when I change the data type from text to duration and it only gives an error where the duration is greater than 24 hours. How is it possible to fix that issue?

Error statement1.png

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors