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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
n8schicht
Helper I
Helper I

remove all characters except a-zA-Z0-9-_ from column Title

Hi,

 

i have some csv-data:

number;title
1;ich bin text nur mit buchstaben und 123456
2;ich bin auch ein text aber mit vielen Sonderzeichen $ / & welche alle gelöscht werden sollen zahlen ( 123454) sollen aber erhalten bleiben
3;ich bin ein Dollarzeichen ($) und soll weg 
4;Ich bin 123“ gross und wiege 54,5 kg
5;mein name ist „Hase“ ich weiss nichts 

how can i only except a-zA-Z0-9-_, characters?

 

the result should be:

 

number;title
1;ich bin text nur mit buchstaben und 123456
2;ich bin auch ein text aber mit vielen Sonderzeichen welche alle gelöscht werden sollen zahlen 123454 sollen aber erhalten bleiben
3;ich bin ein Dollarzeichen und soll weg 
4;Ich bin 123 gross und wiege 54,5 kg
5;mein name ist Hase ich weiss nichts 
1 ACCEPTED SOLUTION

@n8schicht 

 

My bad. I think i gave a unneccessary lengthy code

 

Try this one

 

=let Characterstokeep={"0".."9","a".."z","A".."Z","_","-"," "}
in
Text.Select([title],Characterstokeep)

View solution in original post

6 REPLIES 6
Zubair_Muhammad
Community Champion
Community Champion

@n8schicht 

 

Give this a shot as Custom Column

 

=let Characterstoremove=List.RemoveItems(
List.Transform({1..126}, each Character.FromNumber(_)),{"0".."9","a".."z","A".."Z","_","-"," "})
in
Text.Remove([title],Characterstoremove)

okay - this works but i see i have also those charaters in the string:

 

l

Ø

@n8schicht 

 

My bad. I think i gave a unneccessary lengthy code

 

Try this one

 

=let Characterstokeep={"0".."9","a".."z","A".."Z","_","-"," "}
in
Text.Select([title],Characterstokeep)

Hey - yes! thx

 

you also have a idea to let the german umlauts pass? 

like

ä ö ü Ä Ö Ü ß

 

 

zorry my mistake of course:

 

let Characterstokeep={"0".."9","a".."z","A".."Z","_","-"," ","ä","ü","ö","ß","Ä","Ü","Ö"}
in
Text.Select([Title],Characterstokeep)

but now i have a little not funny side effect:

from:

Buschbeck Grillkamin Carmen mit Tisch, grau/terra, 65 x 180 x 203 cm

to:

Buschbeck Grillkamin Carmen mit Tisch grauterra 65 x 180 x 203 cm

is there a way to do this:

Buschbeck Grillkamin Carmen mit Tisch - grau - terra - 65 x 180 x 203 cm

so i mean:

- if there is a character which would be cut is there a possibility to separate them with a 

-

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.