The function Table.SelectRows is a very common power query function that is used to filter a table. It is what is created when you filter rows in a table using the UI. It takes a table and then applies whatever filters are set in the second argument. The following code generates a basic filtered table.
let
Table = Table.FromRecords(
{
[Id = 1, Name = "Amanada", Age = 45],
[Id = 2, Name = "Bob", Age = 13],
[Id = 3, Name = "Christina", Age = 37],
[Id = 4, Name = "David", Age = 23]
}
),
Changed_Type = Table.TransformColumnTypes(Table,{{"Id", Int64.Type}, {"Age", Int64.Type}, {"Name", type text}}),
Filtered_Rows = Table.SelectRows(Changed_Type, each [Age] > 20)
in
Filtered_Rows
