# Power Query delete rows containing X?



## vbaNumpty (May 19, 2021)

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.


```
List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null})))
```

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


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


----------



## Alex Blakenburg (May 20, 2021)

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.


```
= Table.SelectRows(#"Changed Type", each ([Exclusion Test] <> null and [Exclusion Test] <> "x"))
```


----------



## vbaNumpty (May 20, 2021)

Alex Blakenburg said:


> 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.
> 
> 
> ...


Awesome thanks a lot!


----------



## Alex Blakenburg (May 20, 2021)

You are welcome. Thanks for the feedback.


----------

