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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Cannot convert value " of type Text to type Integer

I'm importing data into Power BI and I have "Duration" column which stores duration in seconds. I want to convert it to minutes so I've created a new column and used the following function:

ROUNDUP (mytable[Duration]/60,0)

This function works in my other report. However, it doesn't work in my new report: I'm getting "Cannot convert value " of type Text to type Integer" error. I suspect that this is due to some blank data in Duration column.

I've tried removing blank data by using filtering in power query: power query >> click on Duration table >> filter >> remove empty.

I've also tried to replace blank data: power query>> transform >> replace values >> find "blank" and "null" >> replace with 0. Both methods don't work and I'm still getting error message.

Any ideas, please?

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

HI, @Anonymous 

That must be mytable[Duration] is a text column, means there must be some text format value in it.

Please change the data type of this column into number as below:

5.JPG

Then you filter which row is error.

6.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

4 REPLIES 4
E0657198
New Member

Hi,

 

I am also facing this issue, Any help is greatly appreciated! 

 

Mileage = IF(CALCULATE(FIRSTNONBLANK('Requested_VIN List'[Mileage],1),FILTER(ALL('Requested_VIN List'),'Requested_VIN List'[VIN]='Fleet Ref_VIN_List'[VIN]))="","-",CALCULATE(FIRSTNONBLANK('Requested_VIN List'[Mileage],1),FILTER(ALL('Requested_VIN List'),'Requested_VIN List'[VIN] ='Fleet Ref_VIN_List'[VIN])))
v-lili6-msft
Community Support
Community Support

HI, @Anonymous 

That must be mytable[Duration] is a text column, means there must be some text format value in it.

Please change the data type of this column into number as below:

5.JPG

Then you filter which row is error.

6.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 for your tip @v-lili6-msft! I've changed the data type to decimal number in power query editor and I didn't get any errors but I had some blanks, which I removed in filter >> remove empty.

My new column is now working as expected.

HotChilli
Super User
Super User

You could use the column quality and distribution features under the View menu in Power Query to have a look at your data.  You should be able to find the dodgy values that way.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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