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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
dolphin18
Frequent Visitor

How to remove rows ONLY based on specific column fields

Hello,

 

I have a table where I want to be able to remove rows that have null/blank values but only for specific columns. Using the table below as an example, my table will always have an ID and Location. However, I only want to remove the rows where a null/blank value appears in all columns of Quantity, Due Date, Description, and Order Date. So, ID numbers 6 and 10 will get removed below even though there is still data in the first 2 columns. I am trying to use conditional columns to achieve this, but not sure if this is the best way. Any help would be greatly appreciated, thanks!

 

ID

Location

Quantity

Due Date

Description

Order Date

1

A

8

2/3/25 6:00

AA

null

2

B

null

2/20/25 14:00

BB

null

3

C

9

10/3/24 13:00

null

null

4

D

7

2/6/24 6:00

CC

8/8/25 15:30

5

E

7

1/3/26 6:30

DD

8/8/25 15:30

6

F

null

null

null

null

7

G

null

8/19/25 5:45

EE

null

8

H

7,8

7/3/25 10:00

null

null

9

I

2

6/17/24 17:50

null

null

10

J

bull

null

null

null

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @dolphin18 

Here's how I would do it:

Add a step with this code in the formula bar, where PreviousStep is the previous step in the query:

= Table.SelectRows( PreviousStep, each List.NonNullCount({[Quantity], [Due Date], [Description], [Order Date]}) > 0 )

This selects rows where at least one of those four columns is non-null.

 

Does this work for you?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

2 REPLIES 2
OwenAuger
Super User
Super User

Hi @dolphin18 

Here's how I would do it:

Add a step with this code in the formula bar, where PreviousStep is the previous step in the query:

= Table.SelectRows( PreviousStep, each List.NonNullCount({[Quantity], [Due Date], [Description], [Order Date]}) > 0 )

This selects rows where at least one of those four columns is non-null.

 

Does this work for you?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

This worked! Thank you so much!!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.