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

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

 

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

  1. 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

Leave a Reply to KimberlyCancel reply

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