A map, a map! My kingdom for a Choropleth map! (Power BI)

One of the most fascinating aspect of Business Intelligence is the power to picture data in an easy to understand way. I personally like maps a lot, not the google or bing type with lots of circular points which give very low added value to the information, but the Choropleth maps. Those shaped areas with shaded colors intended to convey an idea at the first sight.

Choropleth maps are mostly used with regional data but they can picture any kind of information on any kind of shape, the idea behind is very simple: you have a SVG image (a vectorial one), with one id for each closed area. Remember those days when we were kids and used the coloring book to paint on pre-designed images?

That’s it. Then you load your data and assign to each id a numeric value to get a colored area with a increasing intensity of color.

This is exactly what the Synoptic panel does.

It’s a custom visual that you can use with Power BI, more on this here. You can download the current version from gitHub, and import it into your Power BI report (yes, it’s free).

The Synoptic panel itself doesn’t paint the picture, you need to have a coded SVG to use with it. And creating a coded SVG is not difficult, you may use any SVG editor, or just go to http://synoptic.design which is an extremely useful web build by the same people who did the custom visual.

I must thank @DanielePerilli for his very good job and his continuous support. He was very responsive and helped me through building my first map.

spanish elections 2011

So in about an hour and a half here we have two maps with polls data from the Spanish elections in 2011. I downloaded the CSV from http://www.electionresources.org/es/data/index_es.html#PROVINCIAS and used the Synoptic panel to create two maps where I filtered respectively the votes obtained by PP and PSOE.

No rocket science, anybody can do that. Just a little caveat, it’s not very intuitive: if you want to have different shades of color, you should drag a field to the “Saturation Values” box in the visualization settings. And if you want to display names on the map, you need to enable “Category Labels” in the format tab of visualization settings. That took me more than 5 minutes to figure out.

Anyway, go download it, create your own map or use those available in the gallery and happy coloring!

How to Lie with Statistics (by Darrell Huff)

I just finished reading this 140 paperback about statistics, and I found it enlightening:
How to Lie with Statistics: Written by Darrell Huff, 1993 Edition, (Reissue) Publisher: W. W. Norton & Company [Paperback]

It was written back in 1954, but the topics it covers are timeless, and -not surprisingly- Mr Huff has few very useful tips applicable to nowadays business intelligence. You can only tell that the text is 60 years old when looking at the details: in one example there is the price of a good hotel room in San Francisco (an eye popping figure: 8$).

One of the first Chapters explains the “biased sample” problem, which affects so many scientific results; another one points the finger to an old trick used to convey distorted messages with line graphs. Many of the wrongdoings he exposes, sounds hard to believe, are still in use today, and you can find plenty of them in ads, magazines, and (sadly) in government polls. Not earlier than one month ago, one very famous cable news network was showing a chart picturing an “impressive” improvement in Spanish unemployment rate: from 26% down to 22% (ouch!). It was something like this:


What they failed to show was data from preceding years:


data source: Spain Unemployment Rate 1976-2015

One of my favorite part is when Mr Huff shows how unions or entrepreneurs give inconsistent (to say the least) results from the same set of data. Or how “experts” sum percentages in an mind bending attempt to rewrite the math rules: “buy any 20 products, wait one year, see their price increase by 5%, so overall the cost of life (20 x 5% = 100%) has doubled in one year…”.

Oh, one last point: don’t forget to read the exhilarating story about the rabbit burger…