Sub topic 10
Why explicit measures beat implicit aggregations
This chapter assumes you can build a basic report in Power BI Desktop and have already written Total Sales, Order Lines, and a DIVIDE ratio in earlier chapters. You should know what filter context is. Here you will see how Power BI aggregates a column when you never write a measure, and why the measures you write by hand are the better choice.
Two ways to get a number into a visual
Suppose your model has a Sales table with a numeric SalesAmount column. You can get a total into a visual in two ways.
- Drag the
SalesAmountcolumn from the Fields pane into a visual. Power BI picks an aggregation for you and shows something like "Sum of SalesAmount". - Drag the
Total Salesmeasure you wrote asSUM(Sales[SalesAmount]).
Both can produce the same number in a simple card visual. They are still different objects.
- An implicit measure is an aggregation that Power BI creates on the fly when you use a column directly in a visual. You never see a formula. The aggregation comes from the column's default summarization setting.
- An explicit measure is a measure you create and name yourself with a DAX formula. It lives in the model, has a visible definition, and can be reused anywhere.
In the Fields pane, columns with a default summarization show a sigma (Σ) icon. That icon means Power BI will aggregate the column automatically when you drop it on a visual.
What can go wrong with implicit aggregations
The aggregation is chosen per column, not per meaning
The default summarization depends on the column's data type, and Power BI can only guess what the column means. A SalesAmount column should be summed. A UnitPrice column, a Discount percentage, or a numeric CustomerKey should not be. If you drag any of them into a table visual, you may get a sum that looks plausible and is wrong.
Users can also change the aggregation in the visual's field well. One report author picks Sum, another picks Average, and two visuals that both say "sales" now disagree. With an explicit measure, the definition is written once in the model and every visual uses it.
You cannot build on them
In an earlier chapter you wrote Average Sales per Order Line = DIVIDE([Total Sales], [Order Lines]). That works only because [Total Sales] and [Order Lines] are named measures. An implicit "Sum of SalesAmount" has no name you can reference in a formula. You would have to rewrite the aggregation inside every new measure, which duplicates logic and invites inconsistency.
The definition is hidden and the formatting is scattered
With an implicit measure, a reader has to open the visual and inspect its field well to learn what is being calculated. Number formatting also becomes a per-visual setting. If you want currency with no decimals, you format each visual separately. An explicit measure carries its format string with it, so every visual that uses it looks the same.
Some environments do not support them
Implicit measures depend on the tool displaying the model. Several situations make them unavailable or unreliable:
- A model that uses calculation groups must have implicit measures disabled. Calculation groups apply to explicit measures only.
- Other tools that connect to the model, such as Excel PivotTables through "Analyze in Excel", do not apply implicit aggregations to numeric columns the way Power BI reports do. Users there can only aggregate the measures you defined.
- Teams that publish a shared semantic model for others to build reports on usually want every number to come from a defined measure, so that the meaning of "sales" does not depend on who built the report.
If you plan to publish a semantic model to others, treat explicit measures as a requirement rather than a preference.
A concrete difference: average with blanks
The two approaches can give different numbers, not just different labels. Take the "Average of SalesAmount" that Power BI offers on a column, and compare it with the measure you built earlier:
Average Sales per Order Line = DIVIDE([Total Sales], [Order Lines])The column average (DAX AVERAGE(Sales[SalesAmount])) ignores rows where SalesAmount is blank. The measure divides total sales by COUNTROWS(Sales), which counts every row, including rows with a blank amount.
Say the filtered Sales table has four rows with SalesAmount values 100, 200, 300, and a blank:
| Calculation | Numerator | Denominator | Result |
|---|---|---|---|
| Implicit Average of SalesAmount | 600 | 3 (non-blank values) | 200 |
| DIVIDE([Total Sales], [Order Lines]) | 600 | 4 (rows) | 150 |
Neither is wrong. They answer different questions: the average of recorded amounts, or the average per order line. Writing the measure forces you to decide which one you mean, and the name documents that decision. With an implicit average, the decision is made by a default you never looked at.
Writing the explicit versions
You already know the core pattern. Here are the measures from earlier chapters as a set. These are the measures a report author should use instead of dragging Sales[SalesAmount].
Total Sales = SUM(Sales[SalesAmount])
Order Lines = COUNTROWS(Sales)
Average Sales per Order Line = DIVIDE([Total Sales], [Order Lines])To create each one, select the Sales table in the Fields pane, choose New measure on the Home or Table tools ribbon, type the formula in the formula bar, and press Enter. If you create a measure while a different table is selected, it lands in that table. Measures belong to a table only for organization, so you can move one by selecting it and changing Home table in Measure tools.
Stop the implicit path from being the easy path
Writing explicit measures is not enough if report authors can still drag the raw column by accident. Close that route with these steps.
- Select the column in the Fields pane (for example
Sales[SalesAmount]). - In Column tools, set Summarize by to None. The sigma icon disappears, and dragging the column into a visual no longer produces an aggregate.
- If nobody needs the raw column in reports, hide it. Right-click it and choose Hide in report view. Hidden columns still work inside measure formulas, so
SUM(Sales[SalesAmount])keeps working.
Do the same for key and ID columns, such as CustomerKey and ProductKey. These are the columns most likely to be summed by mistake.
Do not name a measure like the column it summarizes
A common mistake when replacing implicit measures is giving the explicit measure the same name as the source column, such as a measure called SalesAmount. Power BI requires measure names to be unique within the model's table namespace, and even where the name is allowed, the Fields pane then shows two similar items that are hard to tell apart. Prefer descriptive business names such as Total Sales. Use a name that tells the reader what is being calculated, as covered in the previous chapter on naming and formatting.
Checking what is already in a report
If you inherit a report, you can find implicit measures quickly.
- Look at the field wells of each visual. A field shown as "Sum of SalesAmount" or "Average of UnitPrice" is implicit. An explicit measure shows only its name.
- In the Fields pane, columns with a sigma icon are candidates for implicit aggregation.
- A measure icon (a small calculator) marks explicit measures.
Replace each implicit field by dragging the matching explicit measure into the visual and removing the old field. Then compare the numbers. If they differ, the implicit aggregation was doing something different from what you intended, as in the blank-handling example above.
Trade-offs and when implicit is acceptable
Explicit measures cost a little time. For a quick exploration of a new dataset, dragging a column to see its distribution is faster than writing a measure, and that is a reasonable use. The cost grows when a report is shared or maintained.
| Concern | Implicit aggregation | Explicit measure |
|---|---|---|
| Definition visible | Only in the visual's field well | In the formula bar and model |
| Reusable in other measures | No | Yes, by name |
| Consistent across visuals | Depends on each author | Yes |
| Formatting | Per visual | Set once on the measure |
| Works with calculation groups | No | Yes |
| Speed for a one-off look | Fast | Slower |
A practical rule: use implicit aggregation for throwaway exploration, and use explicit measures for anything a colleague will open, refresh, or build on.
Putting it into practice
Here is a short checklist for converting a report that was built by dragging columns.
- List every numeric column the report aggregates. For each one, decide what the correct aggregation is, or whether it should be aggregated at all.
- Write a named explicit measure for each real aggregation. Use SUM for totals, COUNTROWS for counts of rows, and DIVIDE for ratios built from those measures.
- Set Summarize by to None on every numeric column, and hide columns that should not appear in reports.
- Replace the old fields in each visual with the new measures.
- Format each measure once, with a format string and a display folder if the model has many measures.
Exercise
A colleague drags Sales[SalesAmount] into a card visual and gets "Sum of SalesAmount". Later they write Average Sales per Order Line = DIVIDE([Total Sales], [Order Lines]). Why can't that formula use "Sum of SalesAmount" in place of [Total Sales], and what fixes it?
Show answer
"Sum of SalesAmount" is an implicit measure. It has no name in the model, so a DAX formula cannot reference it. The fix is to create an explicit measure, Total Sales = SUM(Sales[SalesAmount]), and reference it by name. It also helps to set Summarize by to None on Sales[SalesAmount] so authors use the measure instead of the column.
Exercise
The filtered Sales table has four rows. SalesAmount is 100, 200, 300, and blank. What does the implicit Average of SalesAmount show, and what does DIVIDE([Total Sales], [Order Lines]) show? Why do they differ?
Show answer
The implicit average shows 200, because it ignores the blank value and divides 600 by 3. The DIVIDE measure shows 150, because Total Sales is 600 and COUNTROWS(Sales) counts all 4 rows, including the one with a blank amount.
Exercise
Name two reasons you would hide Sales[SalesAmount] after creating Total Sales, and say whether hiding it breaks the SUM formula.
Show answer
Hiding it keeps authors from dragging the raw column and creating an implicit aggregation that can disagree with the measure, and it keeps the Fields pane uncluttered. Hiding does not break the formula: Total Sales = SUM(Sales[SalesAmount]) still works, because hidden columns remain usable inside DAX.