Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

PowerBI Dropping 0's from US zip codes while loading data

When importing a file with zip codes, PowerBI automatically drops all the leading 0's on the zip codes which then causes them to map incorrectly. Is there any way to prevent it from doing this when importing data?

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

     

    Turn off automatic data type detection.

    When you turn off this option, if your data is imported into Power BI Desktop, data will all be displayed as text data type.

                                                                                                                                                             

    Best Regards,

    Stephen Tao

     

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

     

5 Replies

  • eliasayyy's avatar
    eliasayyy
    Memorable Member

    if you are changing the type to whole number , the first 0s will dissapear just change type back to text form and it hsould stay there

  • Anonymous's avatar
    Anonymous
    Not applicable

    Not changing anything right now - PowerBI is automatically converting them to numbers and dropping the 0's - is there a way to prevent that?

    • eliasayyy's avatar
      eliasayyy
      Memorable Member

      go to power query , in the step change type , you will see that the column "ZIP" is not whole number but a text format

      as you see 
      i made a sample dataset


      when it loads , it automatically detects it as whoel number integer

       

      just press on 123 and then choose text

      result

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        For some reason, it's dropping the 0's even before it Prmotes Headers - I can't figure out a way to get it to change to Text before the data shows up.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Turn off automatic data type detection.

    When you turn off this option, if your data is imported into Power BI Desktop, data will all be displayed as text data type.

                                                                                                                                                             

    Best Regards,

    Stephen Tao

     

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