Forum Discussion
Conditional Formatting within Tooltip
- 6 months ago
Hi,
Thanks for the help with this, its much appreciated.
Unfortunately, this isn't the behaviour I'm looking for as a solution, I need the Max & Min month name to be showing in the tooltip, preferably in its own column, your solution doesn't make it immediately obvious what months out of a possible 12 are the Max and Min.
I will close this ticket and re-open a new one.It maybe the fact that what I'm asking for is not even possible so it will be good to re-issue a new version of this ticket to see if that even possible.
Once again, thanks for all your help!
Hello again ArchStanton ,
To address this scenario, it's important to recognize that tooltip visuals operate within a much narrower filter context compared to standard visuals like a matrix. When hovering over a value, the tooltip only considers that specific category, so any logic intended to compare values across categories will not work unless the context is deliberately broadened.
The recommended approach is to use a measure that evaluates all visible categories by applying ALLSELECTED to the category field, then calculating the minimum and maximum from that set while excluding blanks. After creating this measure, add it to a dedicated tooltip page and assign that page to the matrix.
Please find the attached PBIX and Screenshort file for your reference.
Best Regards,
Tejaswi.
Community Support
Thanks again for your advice, i really appreciate all of your help.
Unless you say otherwise I don't think its possible to do what I want?
I want the months of the Max and Min markers in the Sparkline to be shown in the tooltip. The sparklines represent the FY Apr - Mar.
Your Max & Min tooltip does work, it seems like we're not a million miles from achieving my aim?
- v-tejrama6 months agoCommunity Support
Hello ArchStanton ,
The main issue was that the tooltip was only evaluating the single hovered point instead of the full month range shown in the sparkline. To fix this, I rebuilt the example using a proper Calendar table linked to the cases data by date, and added a fiscal month number (Apr–Mar) so the months sort correctly. The tooltip measures then use ALLSELECTED to look across all months in the sparkline context, and TOPN to determine which month has the highest and lowest values, returning the month names instead of just the numbers.I added the measures to a report tooltip page and linked it to the matrix. Now, when you hover over a row, the tooltip shows the actual months where the sparkline reaches its maximum and minimum, not just the values. Because the logic evaluates over the same month context as the sparkline, it works consistently even within the limited filter context of a tooltip.
Please find the attached PBIX and Screenshort file for your reference.
Best Regards,
Tejaswi.
Community Support- v-tejrama6 months agoCommunity Support
Hi ArchStanton ,
I wanted to follow up and see if you had a chance to review the information shared. If you have any further questions or need additional assistance, feel free to reach out.
Thank you.- v-tejrama6 months agoCommunity Support
Hi ArchStanton ,
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.
- ArchStanton6 months agoPower Participant
Hi,
I've tried your latest suggestion and unfortunately it didn't work - it has the same issue as the previous code you provided - it almost works and I prefer the look of this tooltip, could you please check if something can be done with this version first?
As you can see, its very close to working but my pbix file was last refreshed in January and so I have no data for Feb & Mar. Is there something that can be tweaked in the following DAX that ignores the future months of the current Fiscal Year?
MinMax Tooltip = VAR AllTopics = CALCULATETABLE ( ADDCOLUMNS ( VALUES ( 'Cases'[PrimaryTopic2] ), "Value", [Primary Topics] ), ALLSELECTED ( 'Cases'[PrimaryTopic2] ) ) VAR NonBlankValues = FILTER ( AllTopics, NOT ISBLANK ( [Value] ) ) VAR MinValue = MINX ( NonBlankValues, [Value] ) VAR MaxValue = MAXX ( NonBlankValues, [Value] ) VAR CurrentValue = [Primary Topics] RETURN SWITCH ( TRUE (), CurrentValue = MinValue, "MIN", CurrentValue = MaxValue, "MAX", BLANK () )- v-tejrama6 months agoCommunity Support
Hi ArchStanton ,
Power BI is picking the wrong 'minimum' month because blank (NULL) values are being treated like the smallest number. The solution is to adjust the measure so it ignores blanks first, then calculates the minimum only from rows that actually contain numbers, and finally returns the month linked to that real minimum. In short, filter out empty values before doing the MIN calculation, so 'no data' doesn’t get mistaken for the lowest data.
Thank you.