Power Query
Search…
published
Powered By GitBook
Table.SelectRows

Table.SelectRows

Selects the rows that meet the condition function.
function (table as table, condition as function) as table

Description

Returns a table of rows from the table, that matches the selection condition.

Category

Table.Row operations

Examples

Select the rows in the table where the values in [CustomerID] column are greater than 2.
1
Table.SelectRows(Table.FromRecords({
2
[CustomerID = 1, Name = "Bob", Phone = "123-4567"],
3
[CustomerID = 2, Name = "Jim", Phone = "987-6543"] ,
4
[CustomerID = 3, Name = "Paul", Phone = "543-7890"] ,
5
[CustomerID = 4, Name = "Ringo", Phone = "232-1550"]
6
}), each [CustomerID] > 2)
Copied!
Table.FromRecords({ [CustomerID = 3, Name = "Paul", Phone = "543-7890"] , [CustomerID = 4, Name = "Ringo", Phone = "232-1550"] })
Select the rows in the table where the names do not contain a "B".
1
Table.SelectRows(Table.FromRecords({
2
[CustomerID = 1, Name = "Bob", Phone = "123-4567"],
3
[CustomerID = 2, Name = "Jim", Phone = "987-6543"] ,
4
[CustomerID = 3, Name = "Paul", Phone = "543-7890"] ,
5
[CustomerID = 4, Name = "Ringo", Phone = "232-1550"]
6
}), each not Text.Contains([Name], "B"))
Copied!
Table.FromRecords({ [CustomerID = 2, Name = "Jim", Phone = "987-6543"] , [CustomerID = 3, Name = "Paul", Phone = "543-7890"] , [CustomerID = 4, Name = "Ringo", Phone = "232-1550"] })
Last modified 3yr ago