How To Add Measure In Power Bi

How to Add Measure in Power BI

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

  1. Open your Power BI Desktop application.
  2. Connect to your data source by selecting the “Get Data” option from the Home tab.
  3. Select your desired data source from the available options.
  4. Once your data is loaded into the Power BI Desktop, navigate to the “Report” view.
  5. Locate the “Fields” pane on the right side of the screen. This pane displays all the available fields from your data source.
  6. Right-click on the table or dataset where you want to add the measure.
  7. Select the “New Measure” option from the context menu.
  8. A formula bar will appear at the top of the screen, allowing you to enter your custom measure calculation.
  9. Enter a name for your measure in the formula bar. For example, if you want to create a measure to calculate total sales, you can name it “Total Sales”.
  10. Write your measure formula in the formula bar. For instance, if you have a “Sales” column and you want to calculate the sum of all sales, you can enter the formula as “=SUM([Sales])”.
  11. Press Enter to save the measure.
  12. You will now see the newly created measure under the respective table or dataset in the “Fields” pane.
  13. Drag and drop the measure onto the Canvas to visualize it in a visual or create custom visualizations using the measure.

Here’s an example to illustrate the process:

Let’s say you have a dataset containing a table called “Sales” with columns “Product”, “Quantity”, and “Price”. To create a measure to calculate the total sales amount, you can follow the steps mentioned above:

  1. Right-click on the “Sales” table in the Fields pane.
  2. Select “New Measure”.
  3. In the formula bar, enter “=SUMX(Sales, [Quantity] * [Price])”
  4. Press Enter to save the measure.
  5. The new measure, named “Total Sales Amount”, will now be available in the Fields pane under the “Sales” table.
  6. Drag and drop the “Total Sales Amount” measure onto the Canvas to visualize it in a visual or create custom visualizations using the measure.

By adding measures in Power BI, you can perform complex calculations, aggregations, and create insightful visualizations based on your specific requirements.

Leave a comment