Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
cbschley
Helper III
Helper III

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. 



cbschley_0-1692133789842.png

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@cbschley 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.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

8 REPLIES 8
parry2k
Super User
Super User

@cbschley 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.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k this is what I was looking for! Thank you for the thoughts & ideas

parry2k
Super User
Super User

@cbschley 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



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.

parry2k
Super User
Super User

@cbschley  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?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.xltx

 

Its 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

ToddChitt
Super User
Super 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.




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





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. 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.