cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
laboatrunner
New Member

if cell has a number delete row

I have a column that cells either have text or have numbers. If the cell is a number, I want the row deleted. Any recommendations?

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Hi @Syndicate_Admin 

Place the following M code in a blank query to see the steps.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlSK1YlWSgSTRmAyCUwag8lkpdhYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Duplicated Column" = Table.DuplicateColumn(Source, "Column1", "Column1 - Copy"),
    #"Changed Type" = Table.TransformColumnTypes(#"Duplicated Column",{{"Column1 - Copy", type number}}),
    #"Kept Errors" = Table.SelectRowsWithErrors(#"Changed Type", {"Column1 - Copy"}),
    #"Removed Columns" = Table.RemoveColumns(#"Kept Errors",{"Column1 - Copy"})
in
    #"Removed Columns"

 

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Syndicate_Admin
Administrator
Administrator

NewStep=Table.SelectRows(PreviousStepName,each not [ColumnName] is number)

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,407)