Forum Discussion
Conditional Text in a TT page based on segment hovered in stacked column chart
I have a stacked column chart wih three measures on the Y axis:
I have as tooltip page defined, but want to add conditional text based on which segement I'm hovering over (Late, On Time, Completed). How do I do this? I've tried
- selectedmeasurename() returned the name of the measure I tried
- isblank([% Late]) thinking maybe it would be if it weren't hovered over but that doesn't work
The goal is to be able to say " were <Late|On Time|Completed> based on the segment hovered. I'm also planning on hiding a table of info if Late is not hovered.
Can this be done? Thanks in advance!
Hi jjustjjo
When you use separate measures in a visual, the tooltip page can’t tell which one is being hovered. Measures don’t have row context, so there’s no filter value to pass through. A common workaround is to create a disconnected table with a column of measure names, then reference that column in a conditional measure.
Please see the attached pbix.
2 Replies
- Hans-Georg_Puls
Super User
Hi jjustjjo ,
I’ve found a way to determine the column segment. It’s more complicated than I’d thought, and I hope it works in your report too.
The solution is based on a calculation group:
- Define a new calculation group named "Column Segments"
- Name the column of the calculation group something like "Selected Measure"
- Define a calculation item for every of your measures defining the segments. Every items should look like the following one:
A Name for the Segment = IF(SELECTEDMEASURENAME() = "Chart Dummy",[your measure for the segment],SELECTEDMEASURE())
(The IF clause ensures that the only a measure called "Chart Dummy" will be replaced by your segment measures) - Define the Chart Dummy measure:
Chart Dummy = 0
(The exakt definition is irrelevant, because the measure is replaced by the measures defined in the calculation items) - Add Chart Dummy as the only value to the y-axis of your chart
- Add Column Segments[Selected Measure] as a legend to your chart
- Now it should be possible to use the following measure to detect the selected segment at your tooltip page
Tooltip Measure Detector = SELECTEDVALUE('Column Segments'[Selected Measure], "No selection") - Here is an impression from my demo:
Hope that works for you too.
- danextian
Super User
Hi jjustjjo
When you use separate measures in a visual, the tooltip page can’t tell which one is being hovered. Measures don’t have row context, so there’s no filter value to pass through. A common workaround is to create a disconnected table with a column of measure names, then reference that column in a conditional measure.
Please see the attached pbix.