Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
leletran
Frequent Visitor

Formatting non-US zip codes

Hello,

 

Hope all is well! My apology if this was answered elsewhere. I searched the forum and google'd but was not able to find relevant results. I'm working on a shipment dashboard and we send shipments locally and internationally. Thus, we have zip codes that contain both letters and characters. I'm wondering if there's a way to handle formatting US zip as "00000-0000" (or "00000") while leaving the non-US zip unaffected?

 

My original plan was to create two dashboards - one for US, and one for international, but I figured I'd ask here. Any insight is greatly appreciated! Many thanks in advance for the time and help! 

 

Shipments_ZipCodes.png

 

Cheers,

Lele

 

 

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

You could try add a calculated column: 
Formatted ZipCode = IF([CountryColumn] = "United States", format your zip code, [zip code])
As for how to format the US zip codes, you will probably need to use the RIGHT() or LEFT() functions to grab the right bits before and after the hyphen.

View solution in original post

2 REPLIES 2
vicky_
Super User
Super User

You could try add a calculated column: 
Formatted ZipCode = IF([CountryColumn] = "United States", format your zip code, [zip code])
As for how to format the US zip codes, you will probably need to use the RIGHT() or LEFT() functions to grab the right bits before and after the hyphen.

Hi Vicky,

 

Good morning! That worked - you are a genuis! Thank you so much for your time and help! 😁 

 

The formula: Formatted ZipCode = IF([RecipientCountry] = "United States", CONCATENATE(LEFT([Zip Code],5), CONCATENATE("-", RIGHT([Zip Code],4))), [Zip Code])

 

Screenshot 2023-03-29 at 9.23.53 AM.png

 

I hope this helps anyone that want to format US- and non-US zip! Thank you again, Vicky. Have a great rest of your morning and day!

 

Cheers,

Lele

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors