Power Query delete rows containing X?

vbaNumpty

Board Regular
Joined
Apr 20, 2021
Messages
171
Office Version
  1. 365
Platform
  1. Windows
Can someone provide me with the line to use in a Power Query to delete all rows that contain a specific value in column 1?

I was trying to repurpose the remove blank columns code with list.contains in place of list.isempty but I am not very familiar with the M language.

VBA Code:
List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null})))

I am thinking I need something along the lines of the following

VBA Code:
List.Contains(List.RemoveMatchingItems(Record.FieldValues(_), {"", null})))      ' No idea where I put the value I am looking to eliminate
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
If you use the Power Query user interface it would look more like this:-
Where [Exclusion Test] is the column / field name used to apply the condition.

Power Query:
= Table.SelectRows(#"Changed Type", each ([Exclusion Test] <> null and [Exclusion Test] <> "x"))
 
Upvote 0
Solution
If you use the Power Query user interface it would look more like this:-
Where [Exclusion Test] is the column / field name used to apply the condition.

Power Query:
= Table.SelectRows(#"Changed Type", each ([Exclusion Test] <> null and [Exclusion Test] <> "x"))
Awesome thanks a lot!
 
Upvote 0

Forum statistics

Threads
1,217,371
Messages
6,136,158
Members
449,995
Latest member
rport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top