Forum Discussion
Custom Tooltip Not Passing Single-Country Filter Context When Y Axis Uses Conditional Logic
Hi all,
I'm building a line chart in Power BI Desktop (Version 2.152.882.0, March 2026) showing number of students per country by academic year, with a custom tooltip page that should display the student count for the hovered country only. I also have a TopN slider that controls how many countries are visible on the chart.
Setup:
- X Axis: Academic Year
- Y Axis: Headcount (DISTINCTCOUNT of InstanceID)
- Legend: Permanent address[Country]
- Custom tooltip page connected via Format > Visual > Tooltips > Report page
- TopN slider using a GENERATESERIES table
The problem:
The custom tooltip works perfectly when the Y axis uses a plain [Headcount] measure — hovering over a data point passes the correct single-country filter context to the tooltip page.
However, as soon as I use any conditional logic on the Y axis measure (to implement TopN filtering by returning BLANK() for countries outside the TopN), the tooltip stops passing single-country context and instead shows all countries.
I've tried several approaches for the Y axis measure, all of which break the tooltip:
Using TOPN + ALL:
Headcount Filtered =
VAR _n = MAX('TopN'[Value])
VAR _currentCountry = SELECTEDVALUE('Permanent address'[Country])
VAR _topCountries =
TOPN(_n, ALL('Permanent address'[Country]), [Headcount Total (All Years)], DESC)
RETURN
IF(_currentCountry IN _topCountries, [Headcount], BLANK())
Using RANKX:
Headcount Filtered =
VAR _rank =
RANKX(ALL('Permanent address'[Country]), [Headcount Total (All Years)], , DESC, DENSE)
RETURN
IF(_rank <= MAX('TopN'[Value]), [Headcount], BLANK())
Using a calculated column for rank (to avoid ALL in the measure):
-- Calculated column on Permanent address table:
Country Rank =
RANKX(ALL('Permanent address'[Country]), [Headcount Total (All Years)], , DESC, DENSE)
-- Measure:
Headcount Filtered =
IF(MAX('Permanent address'[Country Rank]) <= MAX('TopN'[Value]), [Headcount], BLANK())
Even a completely hardcoded version breaks the tooltip:
Headcount Filtered Test =
IF(MAX('Permanent address'[Country Rank]) <= 10, [Headcount], BLANK())
What I've ruled out:
- The tooltip page has no page-level filters
- The line chart has no visual-level filters (removed Is Top N Country filter from Filters pane)
- The relationship between Permanent address and International Sample data is one-to-many, single direction from Permanent address
- Show items with no data is disabled
- Country is correctly in the Legend well
- The plain [Headcount] measure on the Y axis passes context correctly
The core issue:
It seems like any conditional Y axis measure that returns BLANK() destroys the tooltip filter context, regardless of how simple the condition is. Is this a known limitation? Is there a way to implement TopN country filtering on a line chart without using either the Filters pane or conditional logic on the Y axis measure, so that the custom tooltip context is preserved?
Any help appreciated!
Hello ansza,
Thank you for posting your query in the Microsoft Fabric Community Forum.As per Microsoft’s official documentation, report page tooltips rely on the filter context passed from the source visual:
“A report visual can only reveal a page tooltip when tooltip page filters are compatible with the visual's design.” Extend visuals with report page tooltips - Power BI | Microsoft Learn
Microsoft documentation also notes that tooltips are filtered by the data point being hovered:
“When you hover over a visual that includes the selected field, the tooltip appears and filters by the data point where your mouse is hovering.” Create Report Tooltips in Power BI - Power BI | Microsoft Learn
To preserve the correct filter context for tooltip functionality:
- Keep the Y-axis measure as the base measure (e.g., [Headcount])
- Implement Top N logic using a ranking or flag measure
- Apply that flag as a visual-level filter (e.g., Is TopN Country = 1)
This ensures that the Country field is truly filtered in the visual context, allowing the tooltip to receive the correct filter context and display accurate results. For your reference: Customize tooltips in Power BI
Best regards,
Ganesh Singamshetty.
6 Replies
- Kedar_Pande
Super User
Measures returning BLANK() break tooltip filter propagation in line charts.
Remove Headcount Filtered from Y-axis → use plain [Headcount]
Filters pane → Visual level → drag Permanent address[Country]
Filter type: Top N → By value: [Headcount Total (All Years)], Value: MAX('TopN'[Value])
- anszaNew Member
Thanks for the suggestion! I tried implementing the Top N filter in the Filters pane with Permanent address[Country] as the field and [Headcount Total (All Years)] as the by value, but ran into another issue - the Top N filter value field seems to only accept hardcoded numbers, not dynamic measure references. So MAX('TopN'[Value]) isn't accepted there. Is there a known workaround for this?
- v-ssriganesh
Community Support
Hello ansza,
Thank you for posting your query in the Microsoft Fabric Community Forum.As per Microsoft’s official documentation, report page tooltips rely on the filter context passed from the source visual:
“A report visual can only reveal a page tooltip when tooltip page filters are compatible with the visual's design.” Extend visuals with report page tooltips - Power BI | Microsoft Learn
Microsoft documentation also notes that tooltips are filtered by the data point being hovered:
“When you hover over a visual that includes the selected field, the tooltip appears and filters by the data point where your mouse is hovering.” Create Report Tooltips in Power BI - Power BI | Microsoft Learn
To preserve the correct filter context for tooltip functionality:
- Keep the Y-axis measure as the base measure (e.g., [Headcount])
- Implement Top N logic using a ranking or flag measure
- Apply that flag as a visual-level filter (e.g., Is TopN Country = 1)
This ensures that the Country field is truly filtered in the visual context, allowing the tooltip to receive the correct filter context and display accurate results. For your reference: Customize tooltips in Power BI
Best regards,
Ganesh Singamshetty. - v-ssriganesh
Community Support
Hello ansza,
We hope you're doing well. Could you please confirm whether your issue has been resolved or if you're still facing challenges? Your update will be valuable to the community and may assist others with similar concerns.
Thank you.
- v-ssriganesh
Community Support
Hello ansza,
Hope everything’s going great with you. Just checking in has the issue been resolved or are you still running into problems? Sharing an update can really help others facing the same thing.
Thank you.