Forum Discussion
Niels_NL
10 years agoAdvocate I
Remove leading zero's from a string
Hey guys, the situation is as follows: I have a set of values (string-type) that can either contain a number or the value 'AFW' (i.e.: unknown data). However, some numbers have leading zero's at ...
- 10 years ago
Hi,
You could try something like this. This code will first check if the string can be converted into a number - if it can't then it will just return the string else it will convert the string to a number (removing leading zero's) and then turn the number back into a string.
NumberXNoLeadingZero = IF( ISERROR( VALUE( 'Table'[NumberX] ) ), 'Table'[NumberX], CONCATENATE( VALUE('Table'[NumberX]), "" ) )