Leading zeroes in Power BI: Restoring them from auto-detection of data types

1–2 minutes

Power BI tries to be helpful and auto-detects data formats such as dates, decimal numbers and integers. However if you’re dealing with zip codes, employee IDs, product IDs, etc. that have leading zeroes, you may not want them auto-converted to integers/number format which removes the leading zeroes. Here’s how to get them back.

From Power Query Editor (recommended)

  1. Click the “Data type” icon next to the column name
  2. Select “Text”
    2018-09-06_10-44-29.gif

From Data Tab

  1. Select the column header
  2. From the Modeling tab, change “Data type” to “Text”
    2018-09-06_10-42-06.gif

 


Discover more from Nate Chamberlain

Subscribe to get the latest posts sent to your email.

2 responses to “Leading zeroes in Power BI: Restoring them from auto-detection of data types”

  1. Damien Avatar
    Damien

    I’ve done this and it is still removing the leading zeros. Underlying data in Excel sheet is formatted as text so I’m stuck at how to stop this happening. Help

  2. Kimberly Avatar

    Thank you so much for this!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Nate Chamberlain

Subscribe now to keep reading and get access to the full archive.

Continue reading