Zip code format

I have listed two options below:

  1. As calculated Column:

ZipCodewithLeadingZeros =
SWITCH(
TRUE(),
LEN(‘Table’[ZipCode]) = 5, ‘Table’[ZipCode],
LEN(‘Table’[ZipCode]) = 4, “0” & ‘Table’[ZipCode],
LEN(‘Table’[ZipCode]) = 3, “00” & ‘Table’[ZipCode]

  1. In PowerQuery, change the column from int64 to text as below

Table.TransformColumnTypes(Table1_Table,{{“Zip Code”, type text}