Using the category placeholder
With the category placeholder, you can add a dimension to the HTML Text Styler visual and have it show the result of your measure for multiple elements. There are endless ways how this can make your report more informative. In this article, you will learn a basic and a more advanced way.
The basic way is shown in the bottom left corner of the report below where we simply make the name of the country bold, then add some text and then show the variance between Actuals and Budget. The more advanced way is shown on the right where we also load the flag of each country from an online source and dynamically format the values green or red.
In This article, we will focus on the basics but you can download the sample file where the DAX and HTML code for the more advanced option is described.
What you need to make this work
First, you need to have a measure that shows a result for the dimension you later want to add to the category placeholder. In our sample, the category by which we want to split is the Country from the Data table. So what we could do is to simply create a measure showing the name of the country or a measure that calculates the variance between Actuals and Budget for a specific country. The measure we are using is the following:
[Variance Actuals – Budget]
The red part of the measure is HTML or hard coded text. With <b> and </b> we define the start and end of the text which should be bold.
MIN(Data[Country]) simply returns the name of the Country
[Variance Actuals – Budget] refers to a measure which calculates the difference between Actuals and Budget.
Adding a dimension to the category placeholder
One you have created the measure, all that’s left to do is to add the additional dimension to the category placeholder. As you can see in the sample file, we added the Country from the Data table into the category placeholder.
To better understand how this feature works, why don’t you go ahead and remove the country from the category placeholder in the sample file?