Sub topic 9
Naming, Formatting, and Organizing Measures
This chapter assumes you can already create a measure in Power BI Desktop and have written SUM, COUNTROWS, and DIVIDE measures against a Sales table. Here you make those measures easy to find, read, and reuse.
Why this matters
A model with five measures is easy to navigate. A model with fifty is not, unless the measures are named consistently, formatted for their meaning, and grouped. Good habits also help report authors who did not write the measures, because they see a clear name and a correctly formatted number in every visual.
Naming measures
A measure name appears in the Fields pane, in visual titles, in tooltips, and inside other formulas. Choose names that read well in all four places.
- Use plain business language:
Total Sales, notts_sumorSumOfSalesAmount. - Use spaces and title case. Measure names can contain spaces, and you reference them in square brackets, such as
[Total Sales]. - Name what the number means, not how it is computed.
Order Linesis better thanCountRowsSales. - Keep a consistent pattern, such as
Total X,Average X per Y, andX %for percentages. - Do not give a measure the same name as a column in any table. A measure reference uses only brackets, while a column reference includes the table name, such as
Sales[SalesAmount]. A shared name makes formulas confusing to read.
The measures from earlier chapters already follow this pattern:
Total Sales = SUM(Sales[SalesAmount])
Order Lines = COUNTROWS(Sales)
Average Sales per Order Line = DIVIDE([Total Sales], [Order Lines])To rename a measure, select it in the Fields pane and press F2, or edit the name at the start of the formula in the formula bar. Power BI updates other measures that refer to it.
Formatting measures
A measure returns a raw number. The format tells Power BI how to display it. Without formatting, Total Sales might show as 1234567.891, which is hard to read.
To set the format:
- Select the measure in the Fields pane.
- Open the Measure tools tab on the ribbon.
- In the Formatting group, choose a format such as Currency, Whole number, Decimal number, or Percentage.
- Set the number of decimal places and, if you want, the thousands separator.
Match the format to the meaning:
| Measure | Suggested format | Example display |
|---|---|---|
| Total Sales | Currency, 0 decimals | $1,234,568 |
| Order Lines | Whole number with thousands separator | 12,480 |
| Average Sales per Order Line | Currency, 2 decimals | $98.93 |
The format belongs to the measure, so every visual that uses it shows the same style. This is one advantage over setting the format separately on each visual.
Organizing measures
Measures live in a table, usually the table of the column they summarize. As the model grows, two techniques keep them manageable: display folders and a dedicated measures table.
Display folders
A display folder groups fields inside a table in the Fields pane. To use one:
- Open Model view.
- Select one or more measures.
- In the Properties pane, type a name into Display folder, such as
Sales Metrics.
You can create nested folders by separating names with a backslash, for example Sales Metrics\Ratios.
A dedicated measures table
Some teams keep all measures in a separate table, often called _Measures, so they appear together at the top of the Fields pane. Create it with Enter data and a single placeholder column, then move measures into it with the Home table setting in the measure's properties. This is a convention, not a requirement. It works well in larger models and adds little in small ones.
Descriptions
Each measure has a Description property in the Properties pane. The text appears as a tooltip when someone hovers over the measure in the Fields pane. Use it for the business definition, for example "Sum of SalesAmount for all order lines in the current filter context."
Common mistakes
- Leaving default names. Names such as
Measure 2give no information to other authors. - Formatting the visual instead of the measure. The formatting is lost when the measure is used in a new visual.
- Percent shown as a decimal. A ratio such as
0.253needs the Percentage format to display as25.3%. - Renaming by deleting and recreating. This breaks any visual or measure that uses the old one. Rename in place instead.
Exercise
You have a measure Average Sales per Order Line = DIVIDE([Total Sales], [Order Lines]) that displays as 98.9285714. Name the setting and the place where you change it so that every visual shows $98.93, and explain why this is better than formatting each visual.
Show answer
Select the measure, open Measure tools, and set the format to Currency with 2 decimal places. The format is stored with the measure, so every visual that uses it shows $98.93 without separate formatting.
Exercise
A colleague names a measure Sales while the model also has a column Sales[SalesAmount] in a table called Sales. Give two reasons to choose a different name.
Show answer
The name is easy to confuse with the table name Sales in formulas and in the Fields pane. It also does not say what the number means. A name such as Total Sales is clearer.