A not-so-well-known feature of the multi-row card visual in Power BI is that it can have its own title, called Card Title, in addition to the title any visual can have. In the image above, the Card Title is blue, and it is formatted separately from the visual title. It only works if you use one measure that returns text, and all other visuals are not text. In this blog post, I’m sharing a technique to display text as values in a multi-row card and still have the special Card Title.
Let’s say you create a multi-row card with Card Title and two numeric measures. The measures are as follows:
Title = "This is a multi-row card title" Some Number = 1 Another number = 2
The result is going to be similar to the following:
Now let’s say you want to add a text measure to the visual:
Some text (wrong) = "a"
As soon as you drop the measure in the field well, your visual will look as follows:
The problem is that to use the Card Title, you must have exactly one measure that returns text, and in this case we have two, so Power BI can’t tell which one is Card Title.
To use a text measure as a value in a multi-row card, we can tamper with data types a bit. What looks like text but is not text? The Variant data type.
You can’t set the type of a measure to Variant yourself, but you can write DAX that instructs Power BI that a measure can potentially return different data types. We can write a measure as follows:
Some text = IF(TRUE, "a", 1)
This measure will never return 1, but this does not stop Power BI from setting its type to Variant behind the scenes. Now that it’s not text, we can have the Card Title:
Thanks to Reid Havens for inspiring me to write this blog post 😊