Forum Discussion

Delta5858's avatar
Delta5858
Frequent Visitor
3 years ago

Want M power query

How to remove all romove all other rows exept specific in advance query editor

3 Replies

  • Hi Delta5858 ,

     

    You need to use Table.SelectRows and give it logic to identify the rows you want to keep.

    It can be as simple as this:

    Table.SelectRows(
        previousStepName,
        each [Region] = "North"
    )

     

    Or it can be a bit more complex, like this:

    Table.SelectRows(
        previousStepName,
        each ([Region] = "North" and [City] = "Manchester" and [Location] = "Trafford")
            or ([City] = "London" and [avgTemperature] <= 22.3)
            or ([Location] = "Alton Towers" and [noofCustomers] > 3000)
    )

     

    Pete

  • depending on the complexity, can you not just apply a filter or series of filters?