Forum Discussion

Terrassa's avatar
Terrassa
Icon for Helper I rankHelper I
2 years ago
Solved

Remove leading zero's for numerical values in alphanumerical column

Hello,   I have a column downloaded from the ERP for the material codes. Some material codes are alphanumerical and thay may or may not start by zero, that's correct.    But some material codes a...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Terrassa 

     

    Please try the following DAX:

    Material Code Cleaned = 
    VAR IsNumeric = NOT(ISERROR(VALUE([Column1])))
    RETURN IF(IsNumeric, FORMAT(VALUE([Column1]), "0"), [Column1])

     

     

     

     

     

     

    Best Regards,

    Jayleny

     

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