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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Aefuentes
Regular Visitor

Cannot convert value '' of type Text to type Integer

Hi guys,

 

I'm working on a project and had this issue.

 

I have a column with ABC123 Format containing values like "10. Very Happy" and others like 8, 9. I tried to clean the "10. Very Happy" values to just 10 using IF and LEN and it worked but the new column is TEXT so AVERAGE function doesn't work.

 

Tried to change the format from text to number but got this message

 

Aefuentes_0-1707398795765.png

 

Hope you can help me.

 

Regards,

 

10 REPLIES 10
PijushRoy
Super User
Super User

@Aefuentes 

Please right click on the column > Transform > and use Trim option to remove extra space in POWER QUERY

PijushRoy_0-1707400647468.png

 

If your requirement is solved, please make THIS ANSWER a SOLUTION




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





For some reason the origin column dont show the button "transform". The others do.

Hi @Aefuentes 

Share sample of data in excel format
or 
Please create a pbix that contains sample data and Upload the pbix to OneDrive, Google Drive, or dropbox and share the link in this thread. If you are using a spreadsheet to create/import the sample data instead of the manual import method, share the spreadsheet as well. 




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Hey,

 

I need to get the average of this column ignoring blanks.

 

Customer Satisfaction
10. Very Happy
10. Very Happy
7
8
10. Very Happy
9

Hi @Aefuentes 

Please use replace value ". Very Happy" to blank like below screenshot

PijushRoy_0-1707403609174.png
Then change datatype and calculate average

If your requirement is solved, please make THIS ANSWER a SOLUTION

 




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





I tried but didn't work.

Aefuentes_0-1707404145660.png

 

The value is "10.Very Happy" not "10. Very Happy" (my bad).

 

Anyways, still the same after the replacement.

Hi @Aefuentes 

I am not able to reproduce the issue, please check Power Query other steps and use the replace before you are using if LEN
Find pbix
https://drive.google.com/file/d/1gnQJ9kmGYeGA9jFQ4BosMqHF71niY4yd/view?usp=sharing




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Hey,

 

I made the .pbix  with the real info.

 

https://drive.google.com/file/d/1VOy1UXcHNfz9UEbwWOo2t63Wi_mZW1-k/view?usp=sharing

 

Please give it a try

 

 

PijushRoy
Super User
Super User

Hi @Aefuentes 

 

There are some extra spaces are there, please clean them when using LEN or IF function
Please right click on the column > Transform > and use Trim option to remove extra space

 

 


Let me know if that works for you


If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.

Thanks
Pijush
Linkedin




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Hey,

I created a new column using TRIM function but didn't work. It still goes

Aefuentes_0-1707399332385.png

Aefuentes_0-1707399451881.png

Aefuentes_1-1707399463111.png

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.