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
jak8282
Helper III
Helper III

Find characters in a string

Is there a way to search for special characters in a string like below

 

"#*&%$£!^+;:?<>"
 
I want to say if it finds any of them its "Invalid"
1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @jak8282 

 

Download example PBIX file

 

In Power Query create a Custom Column with this

 

 

if List.ContainsAny(Text.ToList([String]),Text.ToList("#*&%$£!^+;:?<>")) then "Invalid" else "Valid"

 

 

txtsr.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

4 REPLIES 4
PhilipTreacy
Super User
Super 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



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Kishore_KVN
Super User
Super User

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:

Kishore_KVN_0-1687175797522.png

 

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:

Kishore_KVN_1-1687175848724.png

 

If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!

PhilipTreacy
Super User
Super User

Hi @jak8282 

 

Download example PBIX file

 

In Power Query create a Custom Column with this

 

 

if List.ContainsAny(Text.ToList([String]),Text.ToList("#*&%$£!^+;:?<>")) then "Invalid" else "Valid"

 

 

txtsr.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Thanks Phil - thats great

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.