Forum Discussion
DataFormat.Error: we couldn't convert to Number
Hi Zakaria_1980
Can you create a sample and past it as a table into the body of the post, with both examples?
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
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.
| Value | Date |
| '-770000 | 20200705 |
Thanks in advance.
- Smauro6 years agoSolution SageHi 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.- Zakaria_19806 years agoPost Patron
please tell me exacetly how can i implement what you have proposed ? i'm beginner in using PBI.
Thanks a lot
- Zakaria_19806 years agoPost Patron
below what i go when i added what you have shared with me.
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.
Thanks
- Smauro6 years agoSolution Sage
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