Making Small Multiple Line Charts in Power BI
I’ve recently found myself pining for small multiples as a feature in Power BI. Ended up doing it myself (for line charts, at least). Was productive.
History Lesson
Back in the day when our original Power BI stack was Power Query, PowerPivot and Power View inside Excel, we had this handy little feature in the Power View properties pane called Vertical Multiples, which would just take that category and create as many charts as you needed, based on the values contained in that field. I could do something like this pretty easily:
This still isn’t part of the v2 product, and I’ve been wanting to do this with a line chart for a couple of use cases I’ve had hanging around the office.
Finding Something… Anything…
There’s some visuals out that offer small multiples in some capacity, such as the infographic designer… but it’s a little buggy with negative values.
There’s some pretty good workarounds online for making small multiple bar charts using the matrix visual and conditional formatting (1) (2), but I can’t extend this to my use case.
I briefly got into using the R visuals features for a while, and it was real easy to use ggplot to knock something up. I didn’t find this responsive enough or configurable enough for my needs without significant work. I finally took the plunge and started to research custom visuals development — I’ve used d3.js before, so it can’t be that hard… right?
My First Custom Visual
Turns out… it isn’t too bad! After disappearing down respective Typescript and Power BI custom visuals API rabbit holes for way longer that was probably healthy, I have emerged with something that works pretty well for me. Here’s a couple of examples:
Maybe You’re Interested in Using It Too?
I’ve tinkered enough with it to be happy to release it for other small multiple cravers — it’s currently going through the AppSource submission process and should be available soon through the regular Power BI custom visuals marketplace.
Update (2018–07–24): it’s now available in AppSource
But… if you want it ahead of then, you can download version 1.0.0 from here:
I don’t want to repeat too much of the usage info in that file in this article, but if you want to read some further details online, I’ve added a documentation wiki to my BitBucket repository.
I’m intending to keep pushing on with developing this further and get it certified for use in the Power BI service. There’s a lot more to do… and learn… and fix. I’ll keep you posted on progress as we go!
Feel free to use the issue tracker to log any issues or ideas and I’ll do my best to work on them as time allows. I’ve also added a list of known issues to the wiki, as well as a high-level roadmap.