Forum Discussion

mef47's avatar
mef47
Regular Visitor
6 years ago
Solved

Filtering rows based on cascading sequence

Hi there   I have data in the format given below.   Sample ID Model S K BH00345 mm23 0.029 0.443 BH00345 mm15 0.022 0.018 BH00345 mm14 0.047 1.228 BH00345 gm23 0....
  • v-zhenbw-msft's avatar
    6 years ago

    Hi mef47 ,

     

    We can use the Power Query Editor to meet your requirement.

     

    1. Filter the Model column, delete the rows that contain “gm”.

     

     

    2. We sort the sample ID Ascending, and sort the Model Descending.

     

     

    3. Then we need to Group the Sample ID column.

     

     

    4. And we can add a custom column to add an index column. Each group has an index column.

     

     

    5. Delete the first two columns. And expand the last column.

     

     

    6. At last we need to filter the Rank column equal 1, then delete the rank column.

     

     

     

    The result table just has four rows.

     

    If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

     

    Best regards,

     

    Community Support Team _ zhenbw

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    BTW, pbix as attached.