Table.SelectRowsTable.SelectRows

SyntaxSyntax

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

InfoAbout

Gibt eine Tabelle mit Zeilen aus der table zurück, die der Auswahl condition entspricht.Returns a table of rows from the table, that matches the selection condition.

Beispiel 1Example 1

Auswählen der Zeilen in der Tabelle, in denen die Werte in der Spalte [CustomerID] größer als 2 sind.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 NameName PhonePhone
33 PaulPaul 54 37 89 0543-7890
44 RingoRingo 23 21 55 0232-1550

Beispiel 2Example 2

Auswählen der Zeilen in der Tabelle, in denen die Namen keinen Buchstaben "B" enthalten.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 NameName PhonePhone
22 KlausJim 98 76 54 3987-6543
33 PaulPaul 54 37 89 0543-7890
44 RingoRingo 23 21 55 0232-1550