Sign in or start a free trial to avail of this feature.
8. Introduction to Quick Measures
Quick measures let you create new calculated fields in your data model without writing any code. We’ll use a Quick Measure to calculate the average revenue per State across multiple regions.
- Measures are fields that can be added to the data model by creating formulas in the DAX language
- The Quick Measures feature allows you to add measures without having to create the DAX formula yourself
- Many measures are available, across multiple categories
Average per Category
- In our dataset, the average computes the average revenue per transaction
- A quick measure lets us find the average revenue generated per state
After a Measure is Created
- The measure appears in the field list and can be added to any visualization
- When you select the measure in the field list, you can see the DAX formula used to create it
- This can help you learn DAX by studying examples
In the next two lessons, we'll take a look at the area of quick measures. In Power BI, measures are calculated fields that you can add to your data model and use in your visualizations.
Measures are constructed using the DAX formula language, which we'll learn about in a later series of courses.
However, Power BI allows you to create measures for a number of common situations without any code at all using quick measures.
In this lesson, we use quick measures to calculate the average revenue generated per state.
Let's start by looking at the collection of quick measures available.
We can insert a quick measure by selecting New Quick Measure from the Home tab.
We can see that there's a long list of measures we can compute divided into various categories.
We'll close the window for now.
Before we create a quick measure, let's construct a simple table of reach-in and revenue.
We'll also add a second revenue column, and change the aggregation for this column to Average.
We'll then go to the Formatting pane, select Grid, and increase the text size to 14.
The average we're seeing here is the average revenue per company, as our data set is collected with a single row per company.
Let's say we want to determine the average revenue per state for each region.
We'll calculate this with a quick measure.
We'll select New Quick Measure from the Home tab, and select Average Per Category.
The base value is the value we want to average, in this case Revenue.
The category is the field that we want to compute the average for, in this case state.
As such, we'll drag revenue to base value, and state to category.
This measure will now compute the average revenue generated per state.
Let's click OK, and see the results. As we can see, the measure appears in the field list, and has been given the title Revenue Average By State. Notice the calculator symbol next to the measure name, indicating that this field is a measure. Let's add this measure to the table, and see that the new column gives us an average revenue per state in each region.
For example, the average state in the Midwest region has a revenue of $537,119.
You may have noticed that the DAX formula bar appears at the top of the canvas.
This is the formula that was used to create the measure we just added to the data model. There are some similarities between Excel formulas and DAX formulas, so if you're familiar with Excel, you may recognize some of the elements of the formula.
If not, don't worry. The whole point of Quick Measures is to allow you to create measures without learning how to code. In this lesson, we've introduced Quick Measures and used them to compute the average revenue by state.
In the next lesson, we'll look at some of the other quick measure options.