Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Add zero to value

Hi everyone!!!!

Please help me. Do you know formula to create "custom" column the same picture?

Thank you so much!!!!

  • Ahmedx's avatar
    Ahmedx
    3 years ago

    pls try this

    [
    f = Text.Length([DATA]),
    to= if f < 3 then Text.Repeat("0",3-f) & [DATA] else [DATA]
    ][to]

5 Replies

  • pls try this

     

     

    if List.ContainsAny({[site ID]},{"0".."9"}) 
    
    then "0" & [site ID] else [site ID]

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      thank you so much!!!

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi, so do you know anyway convert to 3 characters for number??? 

      ex: 1 to 001;

           2 to 002;

          10 to 010....

      but if A2, P100, I205 still not change.

      Thank you!!!

      • Ahmedx's avatar
        Ahmedx
        Super User

        pls try this

        [
        f = Text.Length([DATA]),
        to= if f < 3 then Text.Repeat("0",3-f) & [DATA] else [DATA]
        ][to]