ChooseCols
๐ Detailed Example: Table.ChooseColumns
๐ Step 1: Prepare Your Table in Excel
Create a table in Excel (select data → Ctrl + T).
๐งพ Sample Table:
ID
Name
Age
Score
1
Alice
28
90
2
Bob
30
85
3
Charlie
27
92
Table Name: Table1
(default or renamed)
We want to keep only the Name
and Score
columns.
๐งญ Step 2: Load Data into Power Query
Select any cell in the table.
Go to the Data tab → Click From Table/Range under Get & Transform.
Power Query Editor will open with your table loaded.
๐งช Step 3: Use the Table.ChooseColumns
Function
๐ Option A: Formula Bar
If the formula bar isn’t visible:
Go to the View tab in Power Query → ✅ Check "Formula Bar".
Then update the formula like this:
m
CopyEdit
= Table.ChooseColumns(Source, {"Name", "Score"})
๐ Option B: Advanced Editor
Go to Home → Advanced Editor.
Replace the code like this:
m
CopyEdit
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
SelectedColumns = Table.ChooseColumns(Source, {"Name", "Score"})
in
SelectedColumns
✅ What It Does:
Source
: your full table.
Table.ChooseColumns
: picks only the Name
and Score
columns.
The output removes other columns (ID
, Age
) completely.
๐ Result Preview in Power Query:
Name
Score
Alice
90
Bob
85
Charlie
92
๐ฅ Step 4: Load the Result Back to Excel
Click Home → Close & Load.
The filtered table (only Name and Score) appears in a new Excel sheet.
๐ก Tips
๐ง Feature
๐ Description
Table.ChooseColumns
Selects only columns listed by name
Column names are case-sensitive
"Name" ≠ "name"
Use curly brackets {}
To specify column names in a list format
Let me know if you'd like to:
See this example in Power BI
Download a sample Excel file
Make it dynamic (e.g., select columns based on a condition)