Forum Discussion
any to text data type conversion producing unexpected values
- 5 years ago
Anonymous
Try rounding the values first as mentioned on previous message.
Round the values first to 2 decimal places then convert the field to text... then check whether formulas now work
Anonymous
Checking the values have you tried using the functions Text.Start(field, 4) and Text.End(field, 2)?
- Anonymous5 years agoNot applicable
I used Text.Start for my first 4 characters. That works fine. For the other string extraction, I need to get the 2 characters after the decimal point. So, I need to use Text.Range, not Text.End.
- themistoklis5 years agoCommunity Champion
what is the formula that you use ... and also can you share the error with us?
A snapshot that shows which values cannot be converted
You can also try this formula:
Text.Start([Values],4) & Text.Range([Values],Text.PositionOf([Values], ".")+1,2)
- themistoklis5 years agoCommunity Champion
Anonymous
Have you also double checked the values in Excel? It seems that you only display 2 decimal places in excel file while there are more than that
If this is the case then when you load the data on power query, round the values to 2 decimal places
Number.Round([Values],2)
Then change the datatype to text.
Finaly check whether the above formulas work