How To Add A Custom Column In Power Bi

Adding a Custom Column in Power BI

To add a custom column in Power BI, you can follow these steps:

  1. Open Power BI and load the desired dataset into your report.
  2. In the “Fields” pane on the right side of the screen, find the table you want to add the custom column to.
  3. Right-click on the table name and select “Edit Queries” to open the Power Query Editor.
  4. In the Power Query Editor, select the column that you want to base your custom column on.
  5. Go to the “Add Column” tab in the ribbon and click on “Custom Column”.
  6. A formula bar will appear, where you can define your custom column formula.
  7. Enter the desired formula in the formula bar, using the M language syntax. For example, if you want to concatenate two columns together, you can use the following formula: Table.Column1 & Table.Column2
  8. Press Enter to apply the formula and create the custom column.
  9. Click on the “Close & Apply” button in the Power Query Editor to save your changes and return to the report view.

Here’s an example to illustrate the process:

Let’s say you have a table in Power BI called “Sales Data” with columns “Product” and “Quantity”. You want to add a custom column that calculates the total sales for each product by multiplying the quantity with the respective price.

  1. Load the “Sales Data” table into your report.
  2. Open the Power Query Editor for the “Sales Data” table.
  3. Select the “Quantity” column.
  4. Go to the “Add Column” tab and click on “Custom Column”.
  5. In the formula bar, enter the following formula: Sales Data[Quantity] * Sales Data[Price]
  6. Press Enter to create the custom column.
  7. Close the Power Query Editor and return to the report view.

Now, you should have a new custom column called “Total Sales” in your “Sales Data” table, which displays the calculated total sales for each product based on the quantity and price columns.

Same cateogry post

Leave a comment