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

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

Reply
Centaur
Helper V
Helper V

Clean Data

Hello,

How could I remove all:

  1. Dashes
  2. Slashes
  3. Periods
  4. Parenthesis (both opening "(" and closing ")"
  5. # sign
  6. Comma
  7. Leading zeros
  8. Trailing zeros
  9. Spaces

 

thank you very much

3 ACCEPTED SOLUTIONS
Anonymous
Not applicable

For a column:

 

= Table.TransformColumns(TableOrPriorStepName, {{"ColumnName", each Text.Remove(_, {"-", "/", ".", "(", ")"})}})

I didn't add all of your characters, but you get it.

 

--Nate

View solution in original post

Anonymous
Not applicable

Nasically, you are just providing a list of quoted characters to remove, like

 

{"-", "(", ")", " ", "/", ",", ".", "#"} 

 

I'd need to see the leading zeros and trailing zeros, but if you want to get rid of zeros, just add "0" to the list.

 

You could also use

each Text.Select([ColumnName], {{"A".."Z"}, {"a".."z"}, {"1".."9"}}). This will keep only letters and text numbers except zero.

 

--Nate

View solution in original post

Text.Trim will clean up leading and trailing spaces but you can also use it to trim other characters. So you could write this

each Text.Trim(Text.Trim(Text.Remove(_, {"-", "/", "\", ".", "(", ")", "#", ","})), "0")

to remove the listed characters, then remove leading and trailing spaces, then remove leading and trailing "0".

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Nasically, you are just providing a list of quoted characters to remove, like

 

{"-", "(", ")", " ", "/", ",", ".", "#"} 

 

I'd need to see the leading zeros and trailing zeros, but if you want to get rid of zeros, just add "0" to the list.

 

You could also use

each Text.Select([ColumnName], {{"A".."Z"}, {"a".."z"}, {"1".."9"}}). This will keep only letters and text numbers except zero.

 

--Nate

Centaur
Helper V
Helper V

thank you very much!

Anonymous
Not applicable

For a column:

 

= Table.TransformColumns(TableOrPriorStepName, {{"ColumnName", each Text.Remove(_, {"-", "/", ".", "(", ")"})}})

I didn't add all of your characters, but you get it.

 

--Nate

Hi Nate, I thought I could figure that out but I am sorry.  I cant.  Could you kindly add the other ones?  I am a little confused on the leading and trailing 0's, spaces too (at the end and beginning).

 

grateful for the help. 

Text.Trim will clean up leading and trailing spaces but you can also use it to trim other characters. So you could write this

each Text.Trim(Text.Trim(Text.Remove(_, {"-", "/", "\", ".", "(", ")", "#", ","})), "0")

to remove the listed characters, then remove leading and trailing spaces, then remove leading and trailing "0".

Nice!  I resorted to doing it individually but this will certainly clean it up.

Helpful resources

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

Top Kudoed Authors