How To Add A Calculated Column In Power Bi

Adding a Calculated Column in Power BI

Power BI provides the ability to create calculated columns, which are columns derived from an expression or formula based on the data in other columns of a table. These calculated columns are useful for data transformation and creating custom calculations in your Power BI reports. Here’s how you can add a calculated column in Power BI:

  1. Open Power BI Desktop and load your data into the Power Query Editor.
  2. Select the table in which you want to add the calculated column.
  3. Click on the “Modeling” tab at the top of the Power Query Editor.
  4. Click on the “New Column” button in the Calculations group.
  5. Enter a name for your calculated column in the formula bar.
  6. Write the expression or formula for your calculated column in the formula bar.
  7. Press Enter or click the “Check Mark” button to apply the calculated column.

For example, let’s say you have a table called “Sales” with columns for “Revenue” and “Units Sold”. You want to create a calculated column to calculate the average revenue per unit sold. Here’s how you can do it:

  1. Load the “Sales” table into the Power Query Editor.
  2. Select the “Sales” table in the tables list.
  3. Click on the “Modeling” tab at the top of the Power Query Editor.
  4. Click on the “New Column” button in the Calculations group.
  5. Enter “Avg Revenue per Unit Sold” as the name for the calculated column in the formula bar.
  6. Write the following expression in the formula bar: =[Revenue] / [Units Sold]
  7. Press Enter or click the “Check Mark” button to apply the calculated column.

Once the calculated column is added, you can use it in your Power BI reports and visualizations, just like any other column in your table. The calculated column will be recalculated whenever the data in the underlying columns changes.

Read more interesting post

Leave a comment