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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

How to remove any non-numerical characters

Found a couple of answers on this but none that fit my issue - I'm working with data that's been entered into a free text field, and it's a bit of a nightmare. The easiest way to clean it up will be to strip out any letters, punctuation or spaces etc and leave only the numerical values, and then I can look at only the left 9 characters. Can this be done in a calculated column? Below is an example of the sort of mess I'm working with, they should all be in the same format as the first line!

 

DT Number
817754788
817754749;  ZLODT 817754832
817751095/817751096
817754865, 817754869, 817755578
817754898 817754906
ZLO DT 817792131

 

Thanks

 

2 ACCEPTED SOLUTIONS
DataInsights
Super User
Super User

@Anonymous,

 

In Power Query, create this custom column. The ranges such as 32 - 47 refer to ASCII characters.

 

Text.Remove(
      [DT Number],
      {
        Character.FromNumber(32) .. Character.FromNumber(47),
        Character.FromNumber(58) .. Character.FromNumber(255)
      }
    )

 

DataInsights_0-1652186915501.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Vijay_A_Verma
Super User
Super User

In PQ, in a custom column, you can use below formula

= Text.Select([DT Number],{"0".."9"})

If you want to look at only first 9 characters of extracted numbers

= Text.Start(Text.Select([DT Number],{"0".."9"}),9)

View solution in original post

4 REPLIES 4
Vijay_A_Verma
Super User
Super User

In PQ, in a custom column, you can use below formula

= Text.Select([DT Number],{"0".."9"})

If you want to look at only first 9 characters of extracted numbers

= Text.Start(Text.Select([DT Number],{"0".."9"}),9)
Anonymous
Not applicable

Perfect, thank you!

DataInsights
Super User
Super User

@Anonymous,

 

In Power Query, create this custom column. The ranges such as 32 - 47 refer to ASCII characters.

 

Text.Remove(
      [DT Number],
      {
        Character.FromNumber(32) .. Character.FromNumber(47),
        Character.FromNumber(58) .. Character.FromNumber(255)
      }
    )

 

DataInsights_0-1652186915501.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

This also works, thank you!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.