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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
dan--dk
Regular Visitor

We couldn't convert to Number but the columns are all numbers!

Greetings, 

 

I have a list of 13000+ lines, the output from monitoring platform was a little dirty, some of the numbers were enclosed in quotation marks ("43.687" for example). 

 

Through troubleshooting this issue I have removed the quotation marks using find and replace in Excel, and also using replace value within power query. The sanitised number values appear to be the same (screenshot from notepad of one error number and one that works). There is no extra whitespace, I have tried to replace the decimal point in the whole column. 

 

Simply removing the quotations does not fix the issue. Has anyone seen something like this before?

 

For some reason, no matter what I try to do, numbers that used to be in quotes return error when converting to number.

 

Decimal in error.png

 

 

 

 

72f4ec42-ecad-47bd-a564-1d6ba783fa9c.png

 

Notepad check to validate no extra characters and formatting.

Notepad check.png

 

 

 

 

 

Original dataset in Excel including quotations.

Original value from Excel.png

 

 

 

1 ACCEPTED SOLUTION
dan--dk
Regular Visitor

Sorry for the delay all. None of the suggestions worked. I had to go back to source data.

The issue was due to an error in conversion and some errors with numbers saved as text. 

My data had been rolling around in the mud and needed to be sanitised. 

 

Thank you all for your suggestions and help. 

View solution in original post

6 REPLIES 6
dan--dk
Regular Visitor

Sorry for the delay all. None of the suggestions worked. I had to go back to source data.

The issue was due to an error in conversion and some errors with numbers saved as text. 

My data had been rolling around in the mud and needed to be sanitised. 

 

Thank you all for your suggestions and help. 

v-cgao-msft
Community Support
Community Support

Hi @dan--dk ,

 

Could you please intercept this data and post example files of the conversion steps? This will help.

How to provide sample data in the Power BI Forum

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Ahmedx
Super User
Super User

you first change the dot to a comma, and then remove the quotes

ERD
Super User
Super User

@dan--dk,

You can try to load data to the Power Query as it is and clean it fully from there. Here are the steps you can use:

ERD_0-1689944971765.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WsjTSMzUzUorViVaKUTI01DM0ilEC80yN9QwNlWJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    
    #"Replaced Value" = Table.ReplaceValue(Source,"""","",Replacer.ReplaceText,{"Column1"}),
    #"Trimmed Text" = Table.TransformColumns(#"Replaced Value",{{"Column1", Text.Trim, type text}}),
    #"Cleaned Text" = Table.TransformColumns(#"Trimmed Text",{{"Column1", Text.Clean, type text}}),
    #"Changed Type" = Table.TransformColumnTypes(#"Cleaned Text",{{"Column1", type number}})
in
    #"Changed Type"

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

olgad
Super User
Super User

Have you trimmed the values after loading to make sure they dont have whitespaces?

 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Yes, sorry I forgot to mention that, I have also tried using the trim and clean functions on the text field, but the error persists.

 

It is almost like the data is corrupt, but I cannot fathom how xx.xxxx as numerical values could be different from a simliar field.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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