How To Add A Column In Power Bi

To add a column in Power BI, you can use the ‘Add Column’ option available in the Power Query Editor. Here is a step-by-step guide:

  1. Open your Power BI report and go to the ‘Home’ tab.
  2. Click on the ‘Transform Data’ option to launch the Power Query Editor.
  3. In the Power Query Editor, select the table or query you want to add the column to.
  4. Go to the ‘Add Column’ tab in the Power Query Editor.
  5. Choose the desired type of column you want to add from the options available. For example, you can add a custom column, conditional column, or a column from examples.
  6. If you choose to add a custom column, you can use the formula bar to define the custom logic for the column. Power BI supports a wide range of functions and operators for this purpose.
  7. Once you have defined the column logic, click on the ‘Done’ button to add the column to your table or query.
  8. Click on the ‘Close & Apply’ button to apply the changes and exit the Power Query Editor.
  9. The newly added column will now be available in the Fields pane of your Power BI report, and you can use it in your visuals and calculations.

Here is an example: Let’s say you have a table with the following columns: ‘Sales’, ‘Expenses’, and ‘Profit’. You want to add a column called ‘Profit Margin’ that calculates the profit margin percentage for each row.

  1. Open the Power Query Editor and select the table containing the data.
  2. Go to the ‘Add Column’ tab and choose the ‘Custom Column’ option.
  3. In the formula bar, enter the following formula:

=[Profit] / ([Sales] - [Expenses])

  1. Click on the ‘Done’ button to add the column.
  2. Close the Power Query Editor and apply the changes.

Now, the ‘Profit Margin’ column will be available in the Fields pane. You can use it in your visuals or calculations to analyze the profit margin percentage for different scenarios.

Read more

Leave a comment