Sub topic 9
Default tooltips and the Tooltips field well
This chapter assumes you can build bar charts, tables, and matrices in Power BI Desktop. It also assumes you have a star-schema model with a date table and can write simple DAX measures. You should know that every visual is filtered by the filters, slicers, and cross-filtering that reach it.
What a default tooltip is
A tooltip is a small card that appears when a reader hovers over a data point. In Power BI Desktop, hover with the mouse. In the Power BI service on a touch device, tap the data point. Every visual with data points shows a default tooltip without any setup.
The default tooltip lists the values that define the hovered point:
- The category or axis value, such as
Bikeson a bar chart. - The legend value, if the visual has a legend.
- Each measure in the visual's value wells, with its current value.
The tooltip is a view of the filter context of that one data point. Hovering over the Bikes bar means that Category = Bikes is applied, on top of every slicer and page filter. The numbers in the card are the values for that combined context.
The Tooltips field well
The default tooltip only shows what is already in the visual. To show more, drag fields into the Tooltips well. The well is on the Build visual tab of the Visualizations pane, under the other field wells. Some visuals do not have it, such as tables and matrices, because they already show every value in a grid.
Fields in the Tooltips well are evaluated in the same filter context as the hovered data point. You can add two kinds of fields:
- Measures, such as
[Sales YoY %]. Each one is calculated for the hovered point and added to the card. - Columns, such as
Product[Subcategory]. A column is summarized with an aggregation like Count, First, or Max, because a single point can contain many rows.
The added fields do not change the visual itself. A bar chart of sales by category keeps the same bars, but the tooltip can now also show profit margin or order count.
A worked example
A column chart shows [Total Sales] by Product[Category]. The reader asks how each category compares with last year. Define these measures:
Sales PY =
CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
Sales YoY % =
DIVIDE ( [Total Sales] - [Sales PY], [Sales PY] )SAMEPERIODLASTYEAR shifts the dates in the current filter context back one year. It needs a continuous 'Date'[Date] column, which is why the date table is a prerequisite. DIVIDE returns blank instead of an error when [Sales PY] is zero or blank.
Drag [Sales PY] and [Sales YoY %] into the Tooltips well. Hover over the Bikes column. The card now shows the category, Total Sales, Sales PY, and Sales YoY %, all for Bikes.
How the filter context behind a tooltip is built
The tooltip's context comes from several layers, applied together:
- Report, page, and visual-level filters.
- Slicer selections and cross-filtering from other visuals.
- The hovered data point: its axis value, its legend value, and for matrices and similar visuals, its row and column values.
Because the hovered point is added last, tooltip measures cannot show values outside that point unless you remove the filter in DAX. For example, [Share of Total] needs a denominator that uses ALL or ALLSELECTED.
Share of Total =
DIVIDE (
[Total Sales],
CALCULATE ( [Total Sales], ALLSELECTED ( Product[Category] ) )
)This measure is a good tooltip field. The reader sees how big the hovered category is relative to the categories currently shown.
Tooltip types in the formatting pane
Select a visual and open Format visual, then General, then Tooltips. The options are:
| Setting | What it does |
|---|---|
| Show tooltip | Turns the tooltip on or off for this visual. |
| Type: Default | Shows the automatic card, plus any Tooltips well fields. |
| Type: Report page | Shows a report page you designed instead of the card. |
| Page | Chooses which tooltip page to show. Only for Report page type. |
| Appearance | Controls text size, font, colors, and background of the default card. |
Report page tooltips are the next chapter's topic. In this chapter, stay with the default type.
Formatting the default tooltip
Under the same Tooltips settings, you can change the label and value font, text size, colors, and the background and transparency of the card. Keep the changes modest. A tooltip is read in a second or two, so a high-contrast, readable card matters more than decoration.
You can also rename fields to make the card clearer. In the Tooltips well, double-click the field name and type a shorter label, such as YoY % instead of Sales YoY %. Renaming applies to that visual only and does not change the model.
Common errors and edge cases
- The Tooltips well is missing. The visual type does not support it. Check whether you selected a table, a matrix, or a slicer. Use a column chart, line chart, scatter chart, or map instead, or build the extra detail into the visual.
- A tooltip column shows
Count of ...orFirst .... A column in the Tooltips well must be aggregated. Use a measure when you need exact control. For example,Top Product = SELECTEDVALUE(...)is clearer thanFirst of Product Name. - A measure shows the same number for every point. The measure removes the filter that comes from the axis, often through
ALLon the wrong table. Check which table the axis column belongs to. - A measure returns blank for some points.
SAMEPERIODLASTYEARreturns blank when there is no prior-year data. That is correct behavior, but you can show a fallback text with a separate text measure if needed. - The tooltip does not appear at all. Check that Show tooltip is on in the visual's settings. Also check that the visual is not hidden behind another object, since the hover goes to the top object.
- Slow tooltips. Each tooltip fires its own query on hover. A heavy measure in the Tooltips well makes the card lag. Test with realistic data volume, and keep the number of tooltip measures small.
When the default tooltip is enough
Use the default tooltip with a few extra Tooltips-well fields when the reader needs one to four more numbers about the hovered point. When the reader needs a chart, a trend, or a layout with several items, the default card is too limited. That is the case for a report page tooltip, which this tutorial covers next.
Exercise
A column chart shows [Total Sales] by Product[Category]. You add [Sales YoY %] to the Tooltips well, and hovering over the Bikes column shows the YoY value for Bikes. A colleague asks why Bikes and not the total of all categories appears. Explain what causes this, and name the DAX function you would use inside a new measure to show the hovered category's share of all categories currently shown.
Show answer
The Tooltips well fields are evaluated in the filter context of the hovered data point. Hovering over Bikes adds Category = Bikes to the slicers and page filters, so each measure is computed for Bikes only. To compare with all categories currently shown, use a measure like DIVIDE ( [Total Sales], CALCULATE ( [Total Sales], ALLSELECTED ( Product[Category] ) ) ). ALLSELECTED removes the category filter from the hovered point but keeps the slicer and page filters.
Exercise
You select a matrix and cannot find a Tooltips well. Why, and what are two ways to show extra values on hover for the same data?
Show answer
Some visuals, including tables and matrices, do not have a Tooltips well, because they already display values in a grid. You can add the extra measures as value columns in the matrix. You can also switch to a visual that supports the well, such as a column or line chart, and add the measures there.