Add A Custom Column (Power Query) - Microsoft Support
Maybe your like
You can add a custom column to your current query by creating a formula. Power Query validates the formula syntax in the same way as the Query Editing dialog box. For more information about the Power Query Formula Language, see Create Power Query formulas.
Add a custom column
-
To open a query, locate one previously loaded from the Power Query Editor, select a cell in the data, and then select Query > Edit. For more information see Create, edit, and load a query in Excel.
-
Select Add Column > Custom Column. the Custom Column dialog box appears.
-
Enter a new column name.
-
Insert a column into the Custom Column Formula box by selecting a column from the Available Columns list, and then selecting Insert.Note You can reference multiple columns as long as you separate them with an operator. For example, to calculate a TotalSales column, you add Total and SalesTax using the formula = each [Total] + [SalesTax].
-
Select OK.
-
Once you add a custom column, make sure it has an appropriate data type. If you see the Any
icon to the left of the column header, change the data type to what you want. For more information, see Add or change data types.
Tip You can try another approach to get the results you want. Use a custom column to merge values from two or more columns into a single custom column. For more information, see Merge columns.
Common example formulas
The following table summarizes common examples of custom formulas.
| Formula | Description |
|---|---|
| "abc" | Creates a column with the text abc in all rows. |
| 1+1 | Creates a column with the result of 1 + 1 (2) in all rows. |
| [UnitPrice] * [Quantity] | Creates a column with the result of multiplying two table columns. |
| [UnitPrice] * (1 – [Discount]) * [Quantity] | Calculates the total price, considering the Discount column. |
| "Hello" & [Name] | Combines Hello with the contents of the Name column in a new column. |
| Date.DayOfWeekName([DOB]) | Creates a new column that displays a weekday name, such as Monday, derived from a DOB Date/Time column data type. |
| DateTime.Time([DOB]) | Creates a new column that displays just the time derived from a DOB Date/Time column data type. |
| Date.Month([DOB]) | Creates a new column that displays the month as a number from 1 to 12, such as 4 for April, derived from a DOB Date/Time column data type. |
See Also
Power Query for Excel Help
Add a custom column (docs.com)
Add a column based on a data type (Power Query)
Add an index column (docs.com)
Need more help?
Want more options?
DiscoverCommunityExplore subscription benefits, browse training courses, learn how to secure your device, and more.
Microsoft 365 subscription benefits
Microsoft 365 training
Microsoft security
Accessibility center
Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.
Ask the Microsoft Community
Microsoft Tech Community
Windows Insiders
Microsoft 365 Insiders
Was this information helpful?
Yes No (Send feedback to Microsoft so we can help.) What affected your experience? Resolved my issue Clear instructions Easy to follow No jargon Pictures helped Other Didn't match my screen Incorrect instructions Too technical Not enough information Not enough pictures Other Any additional feedback? (Optional) Submit feedback By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.Thank you for your feedback!
×Tag » How To Create A Helper Column In Excel
-
Excel Helper Column | Exceljet
-
Excel Formula: Extract Data With Helper Column In Excelchat - Got It AI
-
What Is An Excel Helper Column?
-
VLOOKUP With Multiple Criteria In Excel - Create A Helper Column
-
Microsoft Excel - How To Insert A Helper Column? - Super User
-
Excel: Use Helper Cells To Improve Formula Speeds
-
Old School Helper Columns - Excel Tips - MrExcel Publishing
-
How To Use Helper Columns With Concatenated Fields In Excel
-
Excel ProTip - The Benefits Of Helper Columns - Reddit
-
Vlookup With Multiple Criteria Without A Helper Column In Excel (5 ...
-
How To Create A Virtual Helper Column In Google Sheets - InfoInspired
-
Advanced VLOOKUP In Excel: Multiple, Double, Nested - Ablebits
-
Mapping Table Without A Helper Column - Excel University
-
Excel Formula Efficiency 7: Helper Column Speeds Calculation