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 |