Forum Discussion
Tooltip to show measure value
Hi,
Feeling a little stumped with this one. I have a stacked bar chart that has been created using measures as the values:
You can see the measures in the X-axis there ("FunnelBM" is the measure I'm currently hovering over in the chart). I need to use a custom tooltip, and what I want is to show the value of the measure I'm currently hovering over in the chart. So if I'm hovering over "FunnelBM". it'll show the value of "FunnelBM", if I'm hovering over the "FunnelRG" portion, it'll show "FunnelRG", and so on. It's proving difficult!
I've gone all the way back to just seeing if I can just identify the measure at all in the chart using SELECTEDMEASURE(), as in the picture above, but I'm getting nothing. Am i missing something fundamental here?
My easy way out is to throw all the measures into a multi-tiled card and show the values for the whole bar when I'm hovering, but I do feel like I'm missing something obvious here.
- Anonymous1 year ago
Hi EpicTriffid ,
Option 1 – Using Calculation Groups (Recommended Approach)
- Open Tabular Editor.
- Create a calculation group and name it "Tooltip Selector."
- Add a calculation item with the following DAX formula:
Selected Measure Tooltip = SELECTEDMEASURE() - Create a tooltip page in Power BI and add a Card visual that uses this calculation item.
- Assign the tooltip page to your stacked bar chart. When you hover over a bar, the corresponding measure value will be displayed.
Option 2 – Without Tabular Editor (Alternative Method)
- Unpivot all measures in Power Query to create MeasureName and MeasureValue columns.
- Set MeasureName as the category and MeasureValue as the value in your visual.
- The tooltip will display the value for the hovered item.
Rationale
- Calculation groups enable SELECTEDMEASURE() to dynamically return the active measure in context.
- The tooltip page then accurately displays the relevant value.
- The unpivot approach restructures the data to achieve a similar dynamic tooltip effect.
Thank you, Tejaswi.
10 Replies
- sivarajan21
Post Prodigy
Hi EpicTriffid ,
Tooltip Page Approach
- Create a new page specifically for tooltips
- Set the page as a tooltip page:
- Go to Page Settings
- Check "Tooltip" under Page Information
- Set appropriate size (typically 320x240)
- Add a card visual to the tooltip page with this measure:
Hovered Measure = VAR HoveredValue = SELECTEDMEASURE() RETURN IF( NOT ISBLANK(HoveredValue), "Value: " & FORMAT(HoveredValue, "#,##0"), "No Value" )- Apply the tooltip to your main visual:
- Select your stacked bar chart
- Go to Format > General > Tooltips
- Set Type to "Report page"
- Select your tooltip page
Please let me know if this works
Best Regards,
- EpicTriffid
Helper IV
- srlabhe
Super User
Have you tried pulling the same measure in any other type of graph, say Line Graph and check if tooltip shows values there ? If yes then just converting it to Stacked Bar chart should work
- wardy912
Super User
Hi EpicTriffid
SELECTEDMEASURE() won't work in a tooltip in this scenario unfortunately. DAX doesn't know which measure you're hovering over.
My suggestion would be to create a tooltip report page and use a matrix or card visual that shows all measures, but conditionally highlights the one relevant to the hovered segment.
Use a field (like a disconnected table of measure names) to drive conditional formatting or visibility.
Unfortunately, this still won’t dynamically detect the hovered measure — but you can make it look cleaner than a multi-tile card.--------------------------------
I hope this helps, please give kudos and mark as solved if it does!
Connect with me on LinkedIn.
Subscribe to my YouTube channel for Fabric/Power Platform related content!
- EpicTriffid
Helper IV
Hi wardy912,
I think this may be the best option. I'm a little unclear, however, how I would get the conditional formatting to work? Could you please elaborate a little?
Thanks!
- wardy912
Super User
Sorry EpicTriffid
I thought I could get the tooltip page to use conditional formatting correctly but it's not able to recognise the measure i'm hovering over.
Have you considered using a field parameter to select the individual measures rather than stacking them?
- AnonymousNot applicable
Hi EpicTriffid ,
Option 1 – Using Calculation Groups (Recommended Approach)
- Open Tabular Editor.
- Create a calculation group and name it "Tooltip Selector."
- Add a calculation item with the following DAX formula:
Selected Measure Tooltip = SELECTEDMEASURE() - Create a tooltip page in Power BI and add a Card visual that uses this calculation item.
- Assign the tooltip page to your stacked bar chart. When you hover over a bar, the corresponding measure value will be displayed.
Option 2 – Without Tabular Editor (Alternative Method)
- Unpivot all measures in Power Query to create MeasureName and MeasureValue columns.
- Set MeasureName as the category and MeasureValue as the value in your visual.
- The tooltip will display the value for the hovered item.
Rationale
- Calculation groups enable SELECTEDMEASURE() to dynamically return the active measure in context.
- The tooltip page then accurately displays the relevant value.
- The unpivot approach restructures the data to achieve a similar dynamic tooltip effect.
Thank you, Tejaswi.
- AnonymousNot applicable
Hi EpicTriffid ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
Thank you,
Tejaswi.
- AnonymousNot applicable
Hi EpicTriffid ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
Thank you,Tejaswi.