Forum Discussion

dolphin18's avatar
dolphin18
Frequent Visitor
1 year ago
Solved

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 Lo...
  • OwenAuger's avatar
    1 year ago

    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?