ChooseRows

 

๐Ÿ” Detailed Process Flow for Table.ChooseRows in Power Query


๐Ÿ“ Step 1: Load Data into Power Query

๐Ÿงญ Path:
Excel → Data tab → ๐ŸŸฉ Get & Transform Data From Table/Range

๐Ÿ“Œ Purpose: Brings your Excel data into the Power Query editor for transformation.

๐Ÿงพ Sample Data in Excel:

ID

Name

Score

1

Alice

90

2

Bob

85

3

Charlie

92

4

David

88

5

Eva

95


๐Ÿงฐ Step 2: Open Power Query Editor

๐Ÿงญ Path:
Once data is loaded, Power Query Editor opens automatically.

๐Ÿ“Œ You’ll see the table loaded as Source.


๐Ÿงช Step 3: Use Table.ChooseRows Function

๐Ÿงญ Path:
Click Advanced Editor (๐Ÿ“‹) in the Home tab
or
Use the Formula Bar (if enabled).

✍️ Syntax:

m

CopyEdit

Table.ChooseRows(Source, {0, 2, 4})

๐Ÿ“Œ Explanation:

  • Source: the original table.
  • {0, 2, 4}: selects 1st, 3rd, and 5th rows (zero-based indexing).

๐Ÿงพ Output Table:

ID

Name

Score

1

Alice

90

3

Charlie

92

5

Eva

95


๐Ÿ” Optional: Use Dynamic Logic (Advanced)

You can dynamically generate row numbers using List functions:

m

CopyEdit

Table.ChooseRows(Source, List.Range({0..Table.RowCount(Source)-1}, 0, 3))

๐Ÿ“Œ This selects the first 3 rows of the table.


Step 4: Apply and Load

๐Ÿงญ Path:
Click Close & Load (๐Ÿ“ฅ) → Data is returned to Excel.

๐Ÿ“„ Result in Excel: Only the selected rows appear in a new sheet or table.


๐Ÿง  Notes & Tips

๐Ÿ”ง Function

๐Ÿ“˜ Description

Table.ChooseRows

Selects rows by index (zero-based)

Table.SelectRows

Selects rows by condition (e.g., Score > 90)

List.Numbers

Generates a list of row indices dynamically