Forum Discussion
Find characters in a string
Is there a way to search for special characters in a string like below
Hi jak8282
In Power Query create a Custom Column with this
if List.ContainsAny(Text.ToList([String]),Text.ToList("#*&%$£!^+;:?<>")) then "Invalid" else "Valid"Regards
Phil
4 Replies
- PhilipTreacySuper User
Hi jak8282
In Power Query create a Custom Column with this
if List.ContainsAny(Text.ToList([String]),Text.ToList("#*&%$£!^+;:?<>")) then "Invalid" else "Valid"Regards
Phil
- jak8282Helper III
Thanks Phil - thats great
- Kishore_KVNSolution Sage
Hello jak8282 answer provided by PhilipTreacy is the best way.
There is another method as well.. which is create a table with all special characters as below:
Then in the actual table create a column using below DAX:
Check = IF( SUMX('Special Characters Table',FIND('Special Characters Table'[Characters],'Table'[Column],,0))>0,"Invalid","Valid")Output looks like this:
If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!
- PhilipTreacySuper User
Hi jak8282
If my answer worked for you please mark it as the answer so that others can benefit from learning how to solve this problem.
regards
Phil