Forum Discussion
ThomasDay
10 years agoImpactful Individual
strip all Alpha chars from text string?
Hello fellow DAX'ers, This seems like it should be easy. I have a column of text data coming into a zip code field. It's public data meaning sometimes the data reads N/A or the name of a town etc ...
- 10 years ago
Messy, but you could do this:
NoText = Var NoAs = SUBSTITUTE([address],"a","") Var NoBs = SUBSTITUTE(NoAs,"b","") Var NoCs = SUBSTITUTE(NoBs,"c","") Var NoDs = SUBSTITUTE(NoCs,"d","") Var NoEs = SUBSTITUTE(NoDs,"e","") Var NoFs = SUBSTITUTE(NoEs,"f","") RETURN NoFs
Rinse and repeat for all characters.
ThomasDay
10 years agoImpactful Individual
Ah, that's great...I'm was just being lazy!! Thanks, Tom
Greg_Deckler
10 years agoCommunity Champion
Sorry man, you might have better luck in "M" in your Power Query, if I come across something better, I'll let you know.