Table.AlternateRows
Maintains the starting position and alternatively selects and omits consecutive rows in the specified table. Table: The original data table provided as input. Offset: Represents the initial number o...
Table.AlternateRows(table as table, offset as number, skip as number, take as number) as table
Maintains the starting position and alternatively selects and omits consecutive rows in the specified table.
Table: The original data table provided as input.
Offset: Represents the initial number of rows to maintain before commencing the iteration process.
Skip: Indicates the quantity of rows to exclude in each iteration step.
Take: Denotes the amount of rows to retain during each iteration.
Retrieve a table by skipping one row and then keeping one row from the original table using the Power Query M function MTable.AlternateRows. The function takes a table as input and skips one value, keeping one value in the resulting table.
For example, if we have a table with the following records:
- CustomerID = 1, Name = "Bob", Phone = "123-4567"
- CustomerID = 2, Name = "Jim", Phone = "987-6543"
- CustomerID = 3, Name = "Paul", Phone = "543-7890"
By applying MTable.AlternateRows to this table with a skip of 1 and a keep of 1, the resulting table will be:
- CustomerID = 1, Name = "Bob", Phone = "123-4567"
- CustomerID = 3, Name = "Paul", Phone = "543-7890"