Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Delete Bottom N rows based on criteria/condition

Hi, I'm using get data from folder, because I've got a multpiple csv file. All data transformation are made on sample file. I need one aditional step and I need an advice..   I need to delete BOTTO...
  • AlB's avatar
    5 years ago

    Hi Anonymous 

    Try this, where PreviousStep is the current last step in your query

        last2_ = List.LastN(PreviousStep[X], 2),
        res= if Text.Start(last2_{0}, 3) ="XXX" or Text.Start(last2_{1}, 3) ="XXX" then Table.RemoveLastN( PreviousStep, N) else PreviousStep 
    in
        res 

     

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers