Sometimes dashboard/reporting projects call for data visualizations that are not part of the package. Power BI has a lot of visualizations out of the box (OOB) and in AppSource, but when they aren’t enough, what should you do? In come Power BI Custom Visuals.
Power BI Custom Visuals provide a way to extend OOB functionality with other open source visualization tools like D3, jQuery, and R. This gives you a great deal of flexibility in terms of formatting, visual elements, and capabilities. Microsoft even provides the source code for some of their OOB visualizations for you to make tweaks to if you want to try to self-teach yourself how to do this.
Unfortunately, custom visuals can be a lot of effort. You’ve got to know Java, D3, CSS, HTML, and possibly other languages to complete a custom viz package (PBIVIZ). You’ve also got to be intimately familiar with all the different aspects of a custom visual project to be effective. Field well combinations, Formatting options, drill-through, and tooltips all have different areas of the custom visual project you need to know where they are, how to code, and how to tie it all together.
At DesignMind, we help clients break these Power BI custom visuals down so that we can get you a minimum viable product that you can take over and make subtle tweaks to. Here’s some pointers on how to get one of these projects underway.
Power BI Custom Visuals Step by Step
1. Break down the Design elements
As with any project, you need to break down the elements of what you want to build. What may seem simple at a moment’s glance can quickly turn complex when you factor in all the variables. Let’s look at an example.
Below is a circle card visual that Microsoft includes in their tutorial on how to build custom visuals. Let’s break it down to its visual elements:
- Circle with a border
- White background color in the circle
- Value text
- Label text
Okay, not too bad. So let’s say you install this and get everything working on your laptop. Once you start playing with the visual, you start to ask questions: How does resizing the visual work? Does it auto-scale? Should the data labels be fixed position or allow the user formatting options? How do change the background of the circle based on the data? How can I add more data to this visual? What about tooltips? Drill-though?
So after giving it some thought and talking with your team, now your breakdown starts to grow:
- Data wells
- Formatting Options:
- Border/No Border
- Font Size
- Font Color
- Value Positioning
- Label Positioning
Now this is just the beginning. After you and your team have the night to sleep about it, you come back with all kinds of ideas: icons, arrows, sparklines, etc.
Like with all projects, narrowing down the scope to get a minimum viable product (MVP) is critical to getting acceptance, feedback, and championing.
2. Get the Visual Studio Code editor
Visual Studio Code is probably the hottest code editor out there on the market today. (At least for Microsoft development). It’s fast to develop, fast to extend, and continually updated every month just like Power BI! If you don’t already have this tool in your development toolbelt, try it out. It’s great for text editing, but you will ultimately need to learn it if you plan to do anything with custom visuals.
3. Check in your work
If you don’t already have source control, get some. There are plenty of providers out there that you can use for free like GitHub, Bitbucket, or Azure DevOps. Probably the fastest if you don’t already have a source control provider (SCP) is GitHub. To integrate GitHub with Visual Studio Code, all you need is to download and install Git. Checking your code into GitHub is easy and there’s no excuse not to do it this way.
Probably the easiest way to learn how to build Power BI custom visuals is to start with a basic visualization package like D3. There are many examples out there on the web that look fantastic! Try them out and impress your friends.
5. Test live or test in Power BI Desktop
If you go through the Microsoft tutorial online, they walk you through how to setup a development environment which is very helpful if you’re making small incremental changes to your code. In the end though, be sure you can package your custom visual with the pbiviz package command. That produces the magical pbiviz file that you can then import into Power BI Desktop, tie to your data, and publish to the Power BI Service and see your work in all its grandeur.
We’d love to hear from you.
If this task seems daunting, talk to us! We’d love to hear about what custom visual you have in mind and how we might be able to help. Our team at DesignMind has years of experience designing, developing, and architecting Power BI solutions for organizations, large and small. You can see more tips from our Power BI experts here.
Gnanaprakash Rajamanickam is a BI Consultant at DesignMind.