Today's post is a short one with a video to demonstrate what I have learned. I'm a big believer in providing your end user with as much information as possible. Someone new should be able to pick up the report and understand it without needing to get a degree in Power BI or go digging through your company's intranet to learn what's what.
One of the neat features that Power BI provides, is the ability for any visual to act as a filter or 'cross-filter' to other visuals. This provides us with comparative values and highlighted bars, but Power BI tooltip just says 'highlighted', which isn't very helpful.
So, I wanted to create a dynamic title that showed the user what exactly was 'highlighted' as well as what that 'sum of value' that the 'highlighted' was compared to.
You can see how I did it in the video, but the DAX is below:
Title =
VAR _Cat =
IF (
ISFILTERED ( Items[Category] ),
SELECTEDVALUE ( Items[Category] ),
"All Categories"
)
VAR _Item =
CONCATENATEX ( Items, Items[Item], " & " )
RETURN
IF ( ISFILTERED ( Items[Item] ), _Item & " compared to " & _Cat, _Cat )
The basic trick is to use ISFILTERED to figure out if the user has actually filtered by that column, or only by another column. The next trick is to design the report so that the user doesn't accidentally filter by the wrong column in the wrong place.