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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
octalllink
Regular Visitor

Custom column that looks for special characters

 I have a custom column where I'm trying to identify any of the following special characters in a specific field and returning True or False if it has any but I keep getting an error for one of the characters and I tried double double inverted commas but still getting the error.

 

The characters I need to find:

‘, ', ’, ', “, ", ”, ", |, ‘, “, $

 

This is my formula:

if Contains([CustomDataColumn], "‘", "'", "’", "'", "“", """, "”", """", "|", "‘", "“", "$") then "True" else "False"

 

octalllink_0-1719985963005.png

It's the red underlined character I need to fix in this formula, please help?

 

1 ACCEPTED SOLUTION
sevenhills
Super User
Super User

1. Contains does not exists. You may have to use List.Contains 

2. """" - four double quotes has to use if you are searching for double quotes

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclR41DAn8VHDXBCdBKKVYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [aa = _t]),
    #"Renamed Columns" = Table.RenameColumns(Source,{{"aa", "CustomDataColumn"}}),
    #"Added Custom" = Table.AddColumn(#"Renamed Columns", "Custom", each if List.Contains({"'", "“", "”", """"},  [CustomDataColumn]) then true else false)
in
    #"Added Custom"

Hope this helps!

View solution in original post

3 REPLIES 3
sevenhills
Super User
Super User

1. Contains does not exists. You may have to use List.Contains 

2. """" - four double quotes has to use if you are searching for double quotes

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclR41DAn8VHDXBCdBKKVYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [aa = _t]),
    #"Renamed Columns" = Table.RenameColumns(Source,{{"aa", "CustomDataColumn"}}),
    #"Added Custom" = Table.AddColumn(#"Renamed Columns", "Custom", each if List.Contains({"'", "“", "”", """"},  [CustomDataColumn]) then true else false)
in
    #"Added Custom"

Hope this helps!

Ritaf1983
Super User
Super User

Hi @octalllink 
Remove """" from the formula 

Ritaf1983_0-1719986463727.png

you also don't need it logically because you have """ 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

I get this:

octalllink_0-1719986959632.png

it's referring to character 34 ascii code

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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 Solution Authors
Top Kudoed Authors