By: MITCHELL PEARSON
Hey Everyone! I’m excited that I’m finally getting this blog done! Also, I’ve embedded the YouTube video below
Also, in other news, after 8 years of blogging I finally decided to make some kind of logo, it’s a little unique but I like it! Especially how I was able to sneak the board game in there because I love board games!
Here is the video posted on YouTube if you want to watch the steps in action.
What is a Dynamic Title in Power BI?
The idea around a dynamic title is that the name of the title changes automatically to reflect any filters that may be applied. In the automated gif below, watch how the title name changes as I drill down into the chart visual.
Figure 2 – Dynamic title, animated gif
Creating Dynamic Titles in Power BI with SELECTEDVALUE() Function
Creating the dynamic title you saw in Figure 2 above requires a little DAX, not much. First, create a new calculated measure and give it a name, in the YouTube video I called this measure Dynamic Title. Then I used the following expression:
Advertisementshttps://c0.pubmine.com/sf/0.0.3/html/safeframe.htmlREPORT THIS AD
This is a simple expression which will return the name of the country if only one country exist in the filter context, if not, it will return the text “All Countries”. In this example I am navigating a hierarchy, therefore, I want the title name to change for each level of the hierarchy as new filters are being applied. The following screenshot is the completed code from the video:
Conditional Formatting in Power BI on the Title of a visual
The final step is to use the calculated measure on the visualization with the following steps, see animated gif for reference:
- Select visual and navigate to the formatting pane
- Find the title category and expand it.
- Click on the fx icon next to title
- Select field value for Format By
- Select your measure from the drop down list for Based on Field.
- That’s it!
As always, hope this post helped!
Advertisementshttps://c0.pubmine.com/sf/0.0.3/html/safeframe.htmlREPORT THIS AD