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
letitiaB
New Member

Removing the last character from text data?

I'm trying to convert 6-digit postal codes into 5-digits in edit queries. I'm having a couple of issues but the main one is how to remove the last character in a string of text data. Additionally, I'd like to remove spaces and convert all letters to upper case. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

All these are available on the Transform tab in Edit Queries.  

 

To keep only the first five characters of a text field:

  1. Highlight the field
  2. On the Transform menu, click Extract (in Text Column section) -> First Characters, then enter 5 in the dialogue box

 

To remove spaces:

  1. Highlight the field
  2. On the Transform menu, click Replace Values (in Any Column section) -> Replace Values, then enter a space in the Value To Find box and nothing in the Replace With dialogue box

 

To convert all letters to upper case:

  1. Highlight the field
  2. On the Transform menu, click Format (in Text Column section) -> then click UPPERCASE

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

All these are available on the Transform tab in Edit Queries.  

 

To keep only the first five characters of a text field:

  1. Highlight the field
  2. On the Transform menu, click Extract (in Text Column section) -> First Characters, then enter 5 in the dialogue box

 

To remove spaces:

  1. Highlight the field
  2. On the Transform menu, click Replace Values (in Any Column section) -> Replace Values, then enter a space in the Value To Find box and nothing in the Replace With dialogue box

 

To convert all letters to upper case:

  1. Highlight the field
  2. On the Transform menu, click Format (in Text Column section) -> then click UPPERCASE

 

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
Top Kudoed Authors