How to Add a Column in Power BI Query Editor
To add a column in Power BI Query Editor, follow these steps:
- Open the Power BI Desktop application.
- Go to the Home tab.
- Click on “Transform data” to open the Query Editor.
- In the Query Editor, select the table or query you want to add a column to.
- Go to the “Add Column” tab.
- Choose the type of column you want to add from the available options.
- Configure the column settings as needed. This may include defining a formula or providing values.
- Click “OK” to add the column.
- Click on “Close & Apply” to go back to Power BI Desktop.
Here’s an example to help illustrate the process:
Let’s say you have a table in Power BI Query Editor that contains data about sales transactions, including the “Quantity” and “Price” columns. You want to add a new calculated column called “Total Sales” that multiplies the Quantity and Price together.
- Open Power BI Desktop and go to the Home tab.
- Click on “Transform data” to open the Query Editor.
- Select the table containing the sales transaction data.
- Go to the “Add Column” tab.
- Click on “Custom Column” to open the formula editor.
- In the formula editor, enter the following formula:
Total Sales = [Quantity] * [Price]
- Click “OK” to add the column.
- Click on “Close & Apply” to go back to Power BI Desktop.
After following these steps, your table will now have a new column named “Total Sales” that calculates the total sales for each transaction.