How To Add A New Column In Power Bi

How to Add a New Column in Power BI

To add a new column in Power BI, you can use the “Add Column” feature in the Query Editor. Here’s a step-by-step guide on how to do it:

  1. Open Power BI and load the desired dataset into the Query Editor by selecting the data source and connecting to it.
  2. In the Query Editor window, locate the table where you want to add the new column.
  3. Right-click on the table and select “Add Column” from the context menu.
  4. Choose the type of column you want to add, such as a calculated column or a custom column.
  5. If you want to add a calculated column, you can use the formula bar at the top to specify the calculation. For example, you can use mathematical operators, functions, or references to other columns.
  6. If you want to add a custom column, you can define the column name and the formula using the “Custom Column” dialog. This allows you to create a formula using the M or DAX language.
  7. After defining the column name and formula, click on the OK or Apply button to add the new column.
  8. The new column will now appear as part of the table in the Query Editor.
  9. Once you’re done adding columns, click on the Close & Apply button to apply the changes and load the updated data into Power BI.

Here’s an example:

Let’s say we have a table called “Sales” with columns “Product”, “Quantity”, and “Price”. We want to add a new column called “Total Sales” which calculates the total sales for each product.

  1. Open Power BI and load the “Sales” table into the Query Editor.
  2. Right-click on the “Sales” table and select “Add Column” from the context menu.
  3. Select “Custom Column” and enter “Total Sales” as the column name.
  4. In the formula box, enter the formula: = [Quantity] * [Price]
  5. Click on OK to add the new column.
  6. The “Total Sales” column will now be added to the “Sales” table.
  7. Click on the Close & Apply button to apply the changes and load the updated data into Power BI.

Now you can use the new “Total Sales” column in your Power BI reports and visualizations to analyze the total sales for each product.

Read more

Leave a comment