Forum Discussion
How to change tooltip based on hover selection?
I have stacked-bar visual that uses 4 measures in it. When I hover over the individual bar item, it only displays the "first" item for the label. Is there any way I can write a DAX formula to change the display based on the measure that I am hovering over?
For example, in the screenshot below, the "Category" label always displays as "Below SS". But I want it to display the label that cooresponds to the measure that I am hovering over.
Anonymous see attached, making your data unpivot makes things easy, no need to write multiple measures and you can always filter by any attribute/inventory type etc. Tweak the solution as you see fit.
8 Replies
- parry2kSuper User
Anonymous see attached, making your data unpivot makes things easy, no need to write multiple measures and you can always filter by any attribute/inventory type etc. Tweak the solution as you see fit.
- AnonymousNot applicable
parry2k this is what I was looking for! Thank you for the thoughts & ideas
- ToddChittSuper User
Are you Calling a special pop-up Tooltip page for this? How did you set that up?
Also looks like you have 4 individual measure on the Y axis, not a single field Y axis and some field (your 'category') in the Legend section of the chart.
Is it a coincedence that "Below SS Cases" is alphabetically first in the list of those 4 measures? I think not.
- AnonymousNot applicable
Yes I'm calling a separate tooltip for this visual. In this case it's essentially taking the first Category field, which like you mentioned is in ABC order. I don't have anything in the legend section, as I'm using separate calculations to come up with the 4 buckets. Unfortunately using 1 column here doesn't work, because the 4 buckets have logic that need to be derived.
essentially I want the label to display as "Excess" when I hover over "Excess Cases", "Healthy" when I hover over "Healthy Cases", so on and so forth.
- parry2kSuper User
Anonymous can you share sample data and the measure you have used for buckets? maybe a simple change in the model can work here without doing any extra work?
- AnonymousNot applicable
Hi parry2k - below is a link to some sample data from the model. I highlighted a few rows in the dataset that helps describe the problem, and why I'm using a stacked bar chart with 4 measures.
Link to sample data: Inventory Volume.xltxIts possible for a single row to contain both Healthy and Excess inventory, therefore we can't use the Health_Category column. This is why I am using 4 measures in my Y-Axis above. So I want to have a label in the tooltip that cooresponds to the measure I am hovering over. I hope this helps explain the issue in more detail.
Edit: chrome might have issues with that link to OneDrive, but using MS Edge works fine
- parry2kSuper User
Anonymous I just saw the Excel file and to understand further (and the potential solution) can you describe the logic you are using in the measures or share the DAX expression for each measure you are using in the visual
- AnonymousNot applicable
There's actually no logic in the stacked-bar chart. Those sections are just SUMs of the values from the source table; nothing fancy. I just can't figure out how to make the label change to "Healthy" when hovered over Healthy Qty, "Excess" when hovered over Excess Qty etc.