How To Calculate Average Of Measure In Power Bi

How to Calculate Average of Measure in Power BI

In Power BI, you can calculate the average of a measure using the DAX formula language. DAX stands for Data Analysis Expressions and is used to create custom formulas and calculations in Power BI. Here’s how you can calculate the average of a measure:

  1. Create a measure: First, you need to create a measure using DAX. You can do this by going to the Power BI Desktop and selecting the table or column you want to calculate the average for. Right-click on the table or column and select “New Measure”. Give your measure a name and enter the DAX formula for calculating the average.
  2. Use the AVERAGE function: To calculate the average of a measure, you can use the AVERAGE function in DAX. The AVERAGE function calculates the average of a column or expression. You need to provide the column or expression as an argument to the AVERAGE function. For example, if you have a measure called “Sales” in the “Sales” table, you can calculate the average by using the following DAX formula:
  3. AVERAGE(Sales)

  4. Apply the measure to visuals: After creating the measure and calculating the average, you can apply it to Power BI visuals, such as charts, tables, or cards. Simply drag and drop the measure onto the visual or add it as a field in the visual’s properties.

Let’s take an example to illustrate this:

Suppose you have a table called “Sales” with the following columns: “Product”, “Category”, and “Revenue”. You want to calculate the average revenue for each category. Here’s how you can do it:

  1. Create a measure: Right-click on the “Revenue” column and select “New Measure”. Give the measure a name, such as “Average Revenue”.
  2. Enter the DAX formula: In the formula bar, enter the following DAX formula to calculate the average revenue:
  3. Average Revenue = AVERAGE(Sales[Revenue])

  4. Apply the measure: Drag and drop the “Average Revenue” measure onto a table visual. The table will display the average revenue for each category.

By following these steps, you can easily calculate the average of a measure in Power BI.

Related Post

Leave a comment