Table.SelectRowsTable.SelectRows

SintaxeSyntax

Table.SelectRows(table as table, condition as function) as table

SobreAbout

Retorna uma tabela de linhas da table que corresponde à seleção condition.Returns a table of rows from the table, that matches the selection condition.

Exemplo 1Example 1

Seleciona as linhas da tabela em que os valores da coluna [CustomerID] são maiores que 2.Select the rows in the table where the values in [CustomerID] column are greater than 2.

Table.SelectRows(
    Table.FromRecords({
        [CustomerID = 1, Name = "Bob", Phone = "123-4567"],
        [CustomerID = 2, Name = "Jim", Phone = "987-6543"],
        [CustomerID = 3, Name = "Paul", Phone = "543-7890"],
        [CustomerID = 4, Name = "Ringo", Phone = "232-1550"]
    }),
    each [CustomerID] > 2
)
CustomerIDCustomerID NomeName TelefonePhone
33 PaulPaul 543-7890543-7890
44 RingoRingo 232-1550232-1550

Exemplo 2Example 2

Seleciona as linhas da tabela em que os nomes não contêm um "B".Select the rows in the table where the names do not contain a "B".

Table.SelectRows(
    Table.FromRecords({
        [CustomerID = 1, Name = "Bob", Phone = "123-4567"],
        [CustomerID = 2, Name = "Jim", Phone = "987-6543"],
        [CustomerID = 3, Name = "Paul", Phone = "543-7890"],
        [CustomerID = 4, Name = "Ringo", Phone = "232-1550"]
    }),
    each not Text.Contains([Name], "B")
)
CustomerIDCustomerID NomeName TelefonePhone
22 JimJim 987-6543987-6543
33 PaulPaul 543-7890543-7890
44 RingoRingo 232-1550232-1550