Default summarization – Creating Measures Using DAX

Default summarization

It is also important to know that every numeric field has a default summarization that will be applied to it when it is added to a visual in a report. You can see the default summarization for your column in the Column tools tab. You can change the default summarization to another calculation from the dropdown, or even choose Don’t summarize. This last choice is good for things such as ZIP codes, which are numeric columns we want to display as text.

Figure 7.3 – Choosing the default summarization for your column

Next, we will look at how measures use filtering context to calculate the needed value dynamically.

Context is everything!

One of the most powerful things about Power BI is that it does all the calculations of measures in context.

Take the gross revenue calculation we previously discussed. That calculation returns one value per row of my Sales table. But if I use that column in a visual, it will automatically be filtered in the row context of the visual.

Figure 7.4 – Data is summarized depending on its context

This behavior is the same for measures. This is a good thing, else we would have to create one measure per scenario, such as the sum of gross revenue by state or the sum of gross revenue by demographic. Instead, we can have one gross revenue and use it in multiple visuals.

Calculations can be applied in both the row context and the filter context. As you can see from the preceding screenshot, Gross Revenue in the table has one value per line of my Sales table. This is the row context. If I drag it onto a visual, it will sum in the filter context of the visual. This is the default summarization of the Gross Revenue field working in conjunction with the filter context.

The two rows of my table visual, Helicopter and Airplane, each shows the correct gross revenue for their filter context. The total is the gross revenue calculated, ignoring the row filter of Product Item Group. The total is not a summation of the values in the table column; it is a separate calculation.

So, the context of the calculation will have an effect on the calculated value that is displayed.

Leave a Reply

Your email address will not be published. Required fields are marked *

Shopping cart

close