Adding a Column in Power BI
To add a column in Power BI, you need to follow these steps:
- Open your Power BI Desktop application.
- Open the report or dataset you want to work with.
- Click on the “Edit Queries” button located in the “Home” tab.
- A separate window will open, displaying the Power Query Editor.
- In the Power Query Editor, select the table or query from the “Queries” pane on the left-hand side.
- Click on the “Add Column” tab in the ribbon.
- Choose the type of column you want to add. You can select from options like “Custom Column”, “Conditional Column”, “Date”, “Text”, etc.
- Once you select the type of column, a dialog box will open where you can define the column name, formula, and any additional settings specific to the column type you chose.
- Enter the required information and click on the “OK” button to add the column.
- After adding the column, you can perform various operations like sorting, filtering, formatting, etc. on the column data in the Power Query Editor.
- Once you are done with the column modifications, click on the “Close & Apply” button to apply the changes and go back to your report.
Here’s an example to help you understand the process better:
Let’s say you have a table in Power BI with two columns – “Product Name” and “Price”. You want to add a new column that displays the discounted price. Follow the steps mentioned above:
- Open Power BI Desktop and your desired report or dataset.
- Click on “Edit Queries”.
- Select the table containing the data.
- Click on “Add Column” and choose “Custom Column”.
- In the dialog box, enter “Discounted Price” as the column name.
- Define the formula as “=[Price] * 0.9” (assuming you want a 10% discount).
- Click “OK” to add the column.
- You can now see the new “Discounted Price” column in the Power Query Editor’s preview pane.
- Close the Power Query Editor and apply the changes.
- The updated report will now display the original price and the discounted price side by side.
Remember to save your report after making any changes.