Forum Discussion
jjustjjo
Helper II
5 months agoConditional 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, Compl...
- 5 months ago
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.
Hans-Georg_Puls
Super User
5 months agoHi 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.