# Build a product dashboard with Metabase

Building a dashboard with the open-source app Metabase

Having access to data usage data is a key part of Product Management. Being able to quickly visualise and share data is also an important part of helping your team understand the impact of their work.

Metabase is an open source data visualisation tool which sits on top of existing databases you might have. It’s structured around the simple idea that people have “questions” about the data, and it provides a brilliantly intuitive interface to help you and your team answer them.

## Setting up Metabase

Installing Metabase on your own PC/Laptop is pretty simple, and there are a number of other deployment options available if/when you need to host it properly. Follow the relevant links on the Metabase installation page. For an easy first time run, you can simply download the jar file. Once downloaded, you can run it using this command:

    java -jar metabase.jar


In the stream of info that then spews out from the command line, you’ll see a URL to complete the installation - for me this was http://localhost:3000/setup/

As part of the setup, you can add a database, or you can have a look around and add one later - there isn’t much to see without one though. Think of Metabase as a layer on top of all the existing data you have. It can aggregate it, make it presentable, help you extract meaning from your data and then help you communicate that to your team.

For this example, let’s assume we’re managing a web based SaaS product and we’re lucky enough to have a database with a “sessions” table with one row for each session the user has had. Our table has some pretty simple data:

• A session ID
• Start date time
• End date time
• A user ID

To answer a question in Metabase, you don’t have to worry too much about the underlying structure. And, you don’t need to know SQL! There is graphical query builder that lets you simply build queries - here’s an example showing the total number of sessions each month:

Once you have some results, Metabase has loads of powerful visualisations to quickly turn your analysis into something more meaningful. It has many different chart options (bar, line, area, pie) along with more advanced visualisations and maps. You can have combination charts (e.g. bar and line) and tweaking the colours and layout is really quite simple.

If you do know some SQL, then you can fall back to that, giving you even more power over the queries you write. To show the average session time (in minutes) we can write:

SELECT AVG(TIMESTAMPDIFF(SECOND, start_datetime, end_datetime) / 60) as minutes
FROM sessions
WHERE start_datetime > DATE_SUB(curdate(), INTERVAL 10 DAY);


The SQL editor in Metabase is pretty good, with suggestions for column names based on the databases you’ve connected to.

## Building a dashboard

Once you’ve got a few questions filed away, you can start building a dashboard to bring them all together. Metabase has a simple drag-and-drop dashboard layout tool with a grid to help keep things lined up.

This is just scratching the surface! There are a number of other powerful features that you can explore in Metabase:

• You can add filters to the dashboards to make it easy to do on the fly analysis (e.g. to look at the usage for a specific customer or product)
• It can send periodic “pulses” via email based on changes to the data
• You can create easy to share links for either single questions or entire dashboards, and these can be embedded in other websites or apps (e.g. your intranet)

The project is actively maintained with a release every few months. There is also an active support forum if you get stuck!

If you find yourself spending (I mean wasting) a lot of time doing repetitive analysis in Excel and trying to make the charts look nice, I’d suggest giving Metabase a try - it’s open-source and free and all your data stays nice and safe in your own databases.

If you’ve used Metabase, or have any other pointers for simple data analysis and visualisation tools, then let us know in the comments.