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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

Remove all rows if NOT Null

Hello everyone,

To start, I have a huge table with over 10k of entries, which took form somewhat like this.

qinh_ann_0-1670451809927.png

 

I need to remove the entire rows on condition based on Column2. Specifically, I want all rows which do not have null for Column2 to be deleted. 

Technically speaking, I want something similar to:

myTable2 = Table.SelectRows(myTable1, each ([Column2] = null))

OR

myTable2 = Table.RemoveRows(myTable1, each ([Column2] <> null))

which are of course not valid M, since both Table.RemoveRows and Table.SelectRows don't work like that.

So my question is, how could I achieve something like those above?

 

Thanks a lot in advance!

1 ACCEPTED SOLUTION
blopez11
Super User
Super User

Got it.

Still do what I suggest, but change the generated M code from:

[Column2] <> null and [Column2] <> ""

to:

not ( [Column2] <> null and [Column2] <> "" )

View solution in original post

3 REPLIES 3
blopez11
Super User
Super User

Got it.

Still do what I suggest, but change the generated M code from:

[Column2] <> null and [Column2] <> ""

to:

not ( [Column2] <> null and [Column2] <> "" )

blopez11
Super User
Super User

I think if you want to remove rows where column2 is null, just select the down arrow icon next to the column2 name, select Remove Empty, then OK. 

 

blopez11_0-1670453697325.png

 

Anonymous
Not applicable

Hi @blopez11 , sorry I wasn't being clear enough 🙂 What I want to do is to delete those rows that do not hold null value for column2. For example, after applying the query, rows 8 and 9 should be deleted while rows 1 to 7 are still in the table.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors