Table.RemoveLastN

MTabela

Retorna table sem as últimas linhas definidas por countOrCondition. Se omitido, remove só a última linha; se for número, remove essa quantidade a partir do fim; se for condição, remove as linhas enquanto atenderem à condição.

Sintaxe

M
Table.RemoveLastN(table as table, optional countOrCondition as any) as table

Parâmetros

tabletableObrigatório

Tabela de origem.

M
Table.FromRecords({[CustomerID = 1, Name = "Bob", Phone = "123-4567"], ...})
countOrConditionanyOpcional

Número de linhas a remover ou condição que define as linhas finais removidas.

M
1

Retorna

table

Exemplo

M
Table.RemoveLastN(
    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"]
    }),
    1
)

Resultado

M
Table.FromRecords({
    [CustomerID = 1, Name = "Bob", Phone = "123-4567"],
    [CustomerID = 2, Name = "Jim", Phone = "987-6543"],
    [CustomerID = 3, Name = "Paul", Phone = "543-7890"]
})

Mais informações

Subgrupo
Table

Aprender Power Query ao vivo