Over the years, visual headers have significantly improved. You can now use these headers to enhance the appearance of your reports. These headers also come with headings or titles. In this tutorial, I’ll be showing how you can create a Power BI dynamic title or heading in your reports.
A dynamic title or heading can add a lot of value to the visualizations that you are creating.
You can do this based on any measure inside your visualizations. Let’s try to look at this example which was from a previous tutorial that I created.
For this example, I want to show the month with the highest sales based on any date context that I will apply in this filter.
Noticeably, from Nov. 19, 2017 to Oct. 12, 2018, the month when I had the highest sales was in July, 2018. This amounted to 4,834,854.
Analyzing The Highest Revenue Month Measure
Here’s the actual formula that I created to calculate the Highest Revenue Month.
First, I used an iterating function called MAXX.
Then, using the ALLSELECTED function, I scanned through every single month and year using a particular context or filter.
Additionally, you can use the VALUES function for this kind of scenario. This returns unique values in a column. Both the ALLSELECTED and VALUES functions return the exact same result based on the visualization that you’re going to place this into. Hence, it completely depends on what context you put this into.
Then, it will evaluate the Total Revenue of each month in the specified year. Finally, the MAXX function will identify the maximum month with the highest revenue.
Now, I’ll drag the Highest Revenue Month measure into the report.
When I turn this into a card, you will see that it displays 4.83 million.
This was based on the result from the measure that was previously calculated.
If I change the time frame in our filter into Nov. 13, 2016 to Jul. 19, 2018, you’ll see that the highest is now 4,752,209.50 which was from August 2017.
Changing The Format Of The Dynamic Title or Heading
You can also change the format of the displayed result within the card. You can do this through the Data label option under the Formatting Pane.
You can also edit it through the Formatting portion of the Modeling tab.
Adding A Dynamic Power BI Title Or Heading
Now, even if you try to change the timeframe within the Date filter, the displayed results will still change dynamically.
After that, I’ll display a heading or a title stating “This is the current highest month in a particular context.” To do this, I’ll be creating another measure and name it as “Highest Month Text.”
Then, I’ll set its value to “The highest sales month in the selected date context is “& [Highest Revenue Month].
This shows that you can reuse your measures inside the text fields by concatenating it to your text using the ampersand (&) symbol.
I can now drag the Highest Month Text measure into the report.
Then, I can now turn it into a card.
Customizing A Dynamic Title Or Heading In Power BI
Furthermore, there are a couple of updates that you’d probably want to make in this part. You can change the appearance of the text through the Data label option under the Formatting Pane.
For this example, I’ll be changing the size of the data label and make it smaller.
Since it is in a text field, you need to correct its formatting. To do that, just insert the Highest Month Text measure within the FORMAT function. Then, add “$0,000” right after the Highest Revenue Month measure.
Now, you can finally play around with this particular field to make it look how you want it to look. You can utilize it as a pure heading or just a text. As I’ve mentioned, this text field is dynamic. The displayed value within that particular card is changing based on the selection from the Date filter.
Setting The Current Context Based On The Selected Visualization Data
Additionally, if I select a certain data within this visualization, it becomes the current context of the calculation.
The selected context will also be the one to be displayed in the text field.
Always make sure that the text can take into account what a consumer might do in terms of the selections they make.
It also becomes dynamic in terms of the selected context within the State filter. This means that I can dynamically select different states or any other dimensions within the report, and get varying results.
That’s how easy it is to implement these customizations in your reports. In this tutorial, I was able to create a dynamic title or text within a sample Power BI report based on a certain measure. I also discussed how you can change the appearance of the headings within the text field.
There’s definitely a lot of things you can do with all the available features that you can use to make customizations in your visualizations. I’m sure there are many ways you can implement these techniques to create extremely powerful reports and visualizations.
I hope you enjoyed reading this one!
***** Learning Power BI? *****
FREE COURSE – Ultimate Beginners Guide To Power BI
FREE COURSE – Ultimate Beginners Guide To DAX
FREE – 60 Page DAX Reference Guide Download
FREE – Power BI Resources
Enterprise DNA Membership
Enterprise DNA Online
Enterprise DNA Events
***** Related Links*****
Data Visualization Technique in Power BI – Multi Measure Dynamic Visuals
How To Create Automated & Dynamic Power BI Reports
Power BI Visualization Technique: Learn How To Create Background Design Plates
***** Related Support Forum Posts*****
How To Create A Dynamic Header In Power BI
Fix Position For Button In A Table Header
Remove Column Header Not Data
For more header in Power BI support queries to review see here…..