How to Average a Measure in Power BI
In Power BI, you can calculate the average of a measure by using the AVERAGE function. The AVERAGE function calculates the arithmetic mean of a set of values.
Example:
Let’s say we have a sales table with the following columns: Date, Product, Quantity, and Revenue. We want to calculate the average revenue per product.
To calculate the average revenue per product, follow these steps:
- Open Power BI and load your sales table.
- Create a new measure by clicking on “New Measure” in the “Home” tab.
- Enter a name for the measure, for example, “Average Revenue per Product”.
- In the formula bar, type the following formula:
Average Revenue per Product = AVERAGE('Sales'[Revenue])
Make sure to replace ‘Sales’ with the name of your table and ‘Revenue’ with the name of your revenue column.
Once you have entered the formula, press Enter to create the measure.
To display the average revenue per product on a visual, you can add a table or a card visual and drag the “Average Revenue per Product” measure into the “Values” section.
The visual will now show the average revenue per product based on the data in your sales table.
Remember to adjust the measure and column names according to your specific data model.