This article is entirely devoted to my new dashboard. As you may have guessed from the title of the article, this dashboard shows statistics for Covid-19 by countries and is based on data from the Johns Hopkins University. Nothing unusual. So, here it is:
To make it different from thousands of similar dashboards, I had to add a few interesting things to it. Some of them are already described by the Power BI visualization gurus, but several are my own ideas. Or I just reinvented the wheel.
Here is a sample list of features:
- unusual world tile map design
- the color intensity adjustment for the segments on the map (or elsewhere)
- hidden input field in the what-if slicer
- new custom cards from OKViz usage
- on-hover button animation
- playing with conditional button formatting
- customized sorting of bars in the bar chart
- hint for explaining the dashboard
- HD and white shadows
Let’s look into this in more detail.
Yes, as usual, if you are too lazy to read a lot of text (and there is a lot of text), you can download the dashboard here, or from the “portfolio” page. Although I killed a couple of dozens of hours to build it, I absolutely do not mind 🙂
I could tell a long and heroic story of how I came to such decision and such design, but I’m afraid this is not interesting to anyone. Everyone knows that the default maps in Power BI are a complete mess. You and I have a wonderful choice – try to make something that does not hurt the eyes from circles scattered around the world map, or use the wonderful filed map, which sometimes forgets about the existence of Monaco (proofs above, on the dashboard), and regularly loads the resources of your PC no worse than something like World of Tanks.
In general, tormented by the search for the perfect map, I accidentally stumbled upon this article by a Tableau master and fell in love with his version of a harmonized tile map. After all, what infuriates me in ordinary choropleths? The inability to see Qatar, Monaco, and other Liechtenstein-ish countries without a magnifying glass. And what infuriates in ordinary tile maps of the world (see the samples later in the same blog)? That’s right, the complete lack of visibility of geography and unrealistic swirls of the countries of the Caribbean and Oceania. And here – everything is fine – Africa is like Africa, and the Caribbean do not look as if they are now capturing the entire planet.
Someone, of course, can say that this is “neither fish nor fowl”, but such a variation of the map has sunk into my soul, and I will return to it more than once, like the author of the original post. Thank you, Neil!
It remains to draw this beauty in Power BI…
Initially, I planned to use the legendary Synoptic Panel made by Italians, and even created the first version of the dashboard using it, but… it seems they forgot a little about this visual. At least I missed some customization of tooltips and more modern color management. I really hope that Marco and Alberto will find some time to refresh this wonderful custom visual.
There was nothing to do – we only have native shape-map, languishing for the fifth year in a preview, but still getting some new features from month to month. The final tile map was drawn using
both left hands, several sites with coordinates, areas, and eccentrics of the countries of the world, Power Pivot, Inkscape (only vector, only hardcore!), mygeodata.cloud and mapshaper.org sites and a sleepless night. And voila – map has created. Do not ask me to tell you more – it pains me to remember… You can unzip a dashboard, pick up a file with this card (by the way, this is just simple txt) and do whatever you want with it.
The color intensity with conditional formatting
Not so long time ago, Parker in his blog showed a wonderful trick that makes coloring maps much more balanced and representative. He does all this by using the LOG function, which, in our case, smooths extrema in the data series.
I ventured to go a little further. After all, people are different, and where one can see a half-tone difference between the data points, the second will see a single-color mess. Therefore, you need to fasten the option to adjust the color intensity to the dashboard. To do this, I wrap the value of the LOG function with another function – POWER. This is probably the only time in my life when the logarithms and exponentiating came in handy. However, I’m still not sure this solution is the easiest one…
MapFillLogScale = VAR c = [Main Measure Map] RETURN POWER ( IF ( ISBLANK ( c ) || c <= 0, 0, LOG ( c, 10 ) ), [MapFillParameter] )
The function POWER has a second argument – well, the power we raise our expression. The higher the number, the greater the difference in colors. What else we should do? – right, put the what-if stuff in the second argument, and nicely place the slicer on the dashboard. More on this in the next section…
Hide inputs on slicers
Microsoft is sometimes annoying. Why I can hide the what-if slider, but cannot hide the input field which almost always looks awful? In addition to this – we cannot force a separate visual element on the canvas always be on top of others – it goes under another selected element.
Therefore, when I accidentally managed to “permanently” cover the input field, I was very surprised. I’m still not completely sure that the trick works 100% of the time, so please test it.
The solution is simple – we group what-if and the opaque shape that is partially above it. After that, we push another opaque shape on top of this group. That’s all. When highlighting or changing a value in the slider, the what-if slicer magically does not “jump” to the foreground. Miracles happen…
New cards from Italians
In short, they are wonderful. If you have not tried them, be sure to do it today. In some places they work unintuitively, in some places minor bugs raised, but, at the same time, they are a billion times better than their analogs. And they look gorgeous. And do not overload the processor. And absolutely free.
They also have the option of left value alignment. Microsoft, you’re not able to do it for the fifth year 🙂
Button hover animation
Here I was inspired by the buttons on my site, and the general “animated” trend in Power BI in recent weeks.
I tormented for an hour, built 50 images with different lengths of white stripes, put them together in one of the online gif editors (sorry, lost the link), and stuck it as a fill for all my buttons on the dashboard, playing a bit with the options.
It doesn’t look perfect, but we can’t do anything with it. Reid pointed this out in a recent video. Although, in general, the essence is next – you can improve the UI/UX of your dashboard in such a simple way. Or worsen, who knows.
Playing with conditional button formatting
Thanks to this Reid’s video, I rediscovered the buttons for Power BI. Now they can be used not mostly connected with bookmarks, but also as an independent visual element with wide possibilities of conditional formatting. In my case, the buttons are those white lines above the cards that emphasize the currently selected metric on the slicer.
I’m just playing around with conditional formatting for button headers that are partially covered by opaque shapes. Unfortunately, Power BI still believes that a visual element cannot be less than 40 pixels in height, so you have to use these workarounds by combining two visuals instead of using just one button…
Custom interactivity in bar charts
I don’t like the interactivity that the program gives us by default. For example, in this dashboard, I wanted something to happen between a highlight and a filter when clicking on a tile of a country on the right bar chart. That is, that the chosen country would be clearly visible, and, at the same time, inactive countries would not disappear and would not be “reset to zero”.
I did not achieve a perfect result, but still created something interesting. Selected countries are highlighted in color, and depending on the buttons at the bottom of the graph are displayed in different modes. By default, I display them at the top of the chart so you don’t need to painfully look for them among a bunch of other countries.
The price of all this is an additional table with countries and the increased complexity of the formulas and the model as a whole.
I stole the idea from Chris Hamill’s blog. I did not use PowerPoint, but the logic is the same – when you click on “?” the user receives a brief description of each element of the dashboard against the background of this dashboard itself. Of course, you can develop the idea further by adding animations (by the way, all the text is written inside the buttons) or external links to the manual.
HD and white shadows
I do not like dark dashboards. I perfectly understand people who, after an hour of working with programs that use trendy dark colors, cannot find a way out of their office, because everything is floating.
However, this dashboard is not designed to work with for a long time. No one will spend hours searching for insights in it and preparing reports on its basis. Accordingly, black color in this case is quite acceptable.
Well, the shadows … I just could not resist, like many who upgraded to the May desktop version.
In general, I wanted to make them red, but somehow it turned out to be very brutal. Actually, in the current state, the shadows do not interfere with the perception of information, so I left them.
Also, I experimented with the dashboard resolution. In my opinion, it turned out pretty well, however, next time I should reduce the height due to the service bar at the bottom of the screen, which for some reason appears even when viewing the dashboard in full-screen mode.
You can develop the idea further. You can add drill down to a separate country page. You can add a bunch of interesting metrics. You can add a date hierarchy to a graph with dynamics, and smooth it with moving averages. You can add country labels to the map (which I, by the way, will do later). Of course, you can (and even should!) change the data source and collect statistics in the context of the provinces, or even replace the world map with a map of your own country…
That’s all. Once again – you can freely download and improve the dashboard if you want. But, if possible, don’t forget to link to this blog. Deal? 😉