top of page

Excel Arena

This is the place, where we can test the boundaries of Excel functions.

Skip, Remove and Select Top or Bottom rows with condition in Power Query

Our source data includes bird names and quantities combined in a single column.

To separate the text from the numbers, we can apply the following methods.


ree

let

 Source = Excel.CurrentWorkbook(){[Name="Table4"]}[Content],

 Removefirst = Table.RemoveFirstN(Source, each [Details] is text),

 Skip = Table.Skip(Source, each [Details] is text),

 Removelast = Table.RemoveLastN(Source, each [Details] is number),

 First = Table.FirstN(Source, each [Details] is text),

 Last = Table.LastN(Source, each [Details] is number)

in

 Last


While these functions are called FirstN or LastN, they can also take conditions as arguments rather than just the number N.

It's important to note a difference between Table.SelectRows and the functions listed above.

Table.SelectRows evaluates the condition across all rows, while the functions mentioned above cease operation once the condition is not met.

Recent Posts

See All
Recursion in Excel and Power Query

In this post, I will demonstrate recursion in Excel and Power Query with some basic examples. Example 1: You are on a set of stairs that...

 
 
 

Comments


  • Facebook
  • Twitter
  • LinkedIn

©2022 by Excel with Excel. Proudly created with Wix.com

bottom of page