Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
Hi all,
I have got a large table with many columns. One of these columns contain some values that I need, some nulls and some with values I need to remove.
Here is a snippet of the column in BI data view:
I want to keep the values shown in the background. Meanwhile there are thousands of rows where the values in this column is gibberish. I need these values to be blank/nulls instead.
One option is to replace all values where the special character "²" occurs. Another option would be to remove values where the string exceeds 10 characters.
How can I do this in Power Query?
TIA
Solved! Go to Solution.
Hi @winterbloom
Just re-read your question and think I have misunderstood what you want.
If you want to keep all the rows and just remove the values with a ² in them, or that are more than 10 characters, add a Custom Column with this code
= if Text.Contains([Value], "²") or Text.Length([Value]) > 10 then null else [Value]
Then delete the original column.
I'll leave my initial reply as an FYI.
Regards
Phil
Proud to be a Super User!
In the PQ Advanced Editor, add a step that transforms the contents of cells in that column to null if they contain "²" or have more than ten characters.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQyNlGK1YlWMjUztwAzQCKHNpmawTkgGUtDiMJYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
//Transform cells that contain more than 10 characters, or contain ² to null
#"Transform garbage" = Table.TransformColumns(#"Changed Type",{"Column1",
each if Text.Length(_)>10 or Text.Contains(_,"²") then null else _})
in
#"Transform garbage"becomes:
In the PQ Advanced Editor, add a step that transforms the contents of cells in that column to null if they contain "²" or have more than ten characters.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQyNlGK1YlWMjUztwAzQCKHNpmawTkgGUtDiMJYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
//Transform cells that contain more than 10 characters, or contain ² to null
#"Transform garbage" = Table.TransformColumns(#"Changed Type",{"Column1",
each if Text.Length(_)>10 or Text.Contains(_,"²") then null else _})
in
#"Transform garbage"becomes:
Hi @winterbloom
Just re-read your question and think I have misunderstood what you want.
If you want to keep all the rows and just remove the values with a ² in them, or that are more than 10 characters, add a Custom Column with this code
= if Text.Contains([Value], "²") or Text.Length([Value]) > 10 then null else [Value]
Then delete the original column.
I'll leave my initial reply as an FYI.
Regards
Phil
Proud to be a Super User!
Hi @winterbloom
This query filters out any row that has the ² character in it
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQyNlGK1YlWMjUztwAzDAxB8NAmI3MzI2OopAEIGBmYAEUNTZGEDA0ObQKShgZgIZBZEGNiAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Value = _t]),
#"Filtered Rows" = Table.SelectRows(Source, each not Text.Contains([Value], "²"))
in
#"Filtered Rows"
To implement this, click on the Drop Down Arrow in the column header, then click Text Filters -> Does Not Contain
and enter this
Regards
Phil
Proud to be a Super User!
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 11 | |
| 11 | |
| 5 | |
| 4 | |
| 4 |