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

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

Reply
Zakaria_1980
Post Patron
Post Patron

DataFormat.Error: we couldn't convert to Number

Dears,

 

i was looking to replace( '- ) with ( - ) since in my Excel sheet i have some values with '-70000. the dash caused a problem.

when trying to replace it in power query it doesn't allow me to do it. do you have any other idea how to do in power Query

 

i have also in some columns date in this format 20170410, how can i change the colmn so the date will looks like 10/04/2017?

 

br,

 

8 REPLIES 8
Mariusz
Community Champion
Community Champion

Hi @Zakaria_1980 

 

Can you create a sample and past it as a table into the body of the post, with both examples?

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Hello,

 

this is the example you have requested. so in case the cell is written with '- it will be just - and delete (') to be converted into number which is below 0. and for date , i want to be displayed as 06/07/2020.

 

ValueDate
'-77000020200705

 

Thanks in advance.

Hi @Zakaria_1980

I think this should work for you:
#"Transform Stuff" =Table.TransformColumns(PreviousStep,{{"Value", (t) => Number.FromText(Text.Replace(Text.From(t), "'", "")), type number}, {"Date", Date.From, type date}})

You should change PreviousStep to the previous step of your query.



Spyros Mavroforos

Data Consultant


Find me on LinkedIn or drop me an email

eSpyros

below what i go when i added what you have shared with me.

 

Capture.PNG

 

below what i have under power query and i've highlighted what you shared with me, just changing the name of the colmn. thanks to help me with this error.

Capture1.PNG

 

Thanks

You almost got it!

But you should change #"PreviousStep" to #"Changed Type1", you must have missed the part where I said that 🙂

 

It should be

    #"Transf.... (#"Changed Type1", ...
in
    #"Transform Stuff"


Cheers




Spyros Mavroforos

Data Consultant


Find me on LinkedIn or drop me an email

eSpyros

Hi,

 

even with the update, nothing happend (see below)

 

 

Capture.PNG

please can someone help.

thanks

 

please tell me exacetly how can i implement what you have proposed ? i'm beginner in using PBI.

 

Thanks a lot

 

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.

Top Kudoed Authors