Menu Close Get Metabase

Create charts with explorable data

Aug 19, 2020 by The Metabase Team

You can use Metabase’s notebook editor to create questions with explorable charts. People can then click on values to pull up an Action menu, which will give them different options to drill through the chart’s data.

Figure 1. Questions composed in the notebook editor allow people to drill through charts. The GIF demonstrates zooming in on a particular category and timeframe, then viewing the orders that make up one of the bars on the chart.
Figure 1. Questions composed in the notebook editor allow people to drill through charts. The GIF demonstrates zooming in on a particular category and timeframe, then viewing the orders that make up one of the bars on the chart.

In this article, we’ll cover:

The Action menu’s drill-through functionality is only available for certain question types, so let’s review those now.

The different ways you can ask questions of your data in Metabase

There are three different ways to ask questions in Metabase.

Figure 2. Simple and custom questions, and questions written in the native/SQL editor.
Figure 2. Simple and custom questions, and questions written in the native/SQL editor.

All methods share the same visualization features, but only simple and custom questions can provide the Action menu with the auto-generated drill-through functionality.

Question type Description Action menu?
Simple Question Pick some data, view it, and easily filter, summarize, and visualize it. YES
Custom Question Use the advanced notebook editor to join data, create custom columns, do math, and more. YES
Native Query For more complicated questions, you can write your own SQL or native query. NO

The reason that the Action menu is only available for simple and custom questions is because the functionality leverages metadata about your tables and columns. Under the hood, simple and custom questions use the same query building primitives (grouping functions, filtering functions, and so on). In fact, simple and custom questions share a continuum; you can start with a simple question to explore the data (affectionately known as Chill Mode in Metabase), then customize that question with the notebook editor. For even more advanced questions, you have the awesome power of custom expressions at your disposal.

If you prefer SQL (or you want to take advantage of Metabase’s SQL snippets feature), you can take questions composed in the notebook editor, and convert them to SQL at any time (figure 3).

Figure 3. You can convert a question composed in the notebook editor to a SQL question at any time.
Figure 3. You can convert a question composed in the notebook editor to a SQL question at any time.

SQL questions give a lot more freedom of expression — you have all of SQL at your disposal — but you lose the tight coupling with the metadata that makes drill-through possible.

An example question composed with the notebook editor

Let’s tour the drill-through functionality available in the Action menu. If you’d like to follow along, see figure 4 for a screenshot of the question in the notebook editor. The visualization has been set to a stacked bar chart (Figure 5).

Figure 4. The question, composed in the <strong>notebook editor</strong>, use in the following drill-through examples.
Figure 4. The question, composed in the notebook editor, use in the following drill-through examples.
Figure 5. Setting the visualization to a stacked bar chart.
Figure 5. Setting the visualization to a stacked bar chart.

The Action menu

Clicking on a value in your chart presents an Action menu with the different drill-through options you can take to explore your data.

Figure 7. Clicking on a value of a chart will bring up the action menu, presenting options to zoom in, view records, breakout, and X-ray.
Figure 7. Clicking on a value of a chart will bring up the action menu, presenting options to zoom in, view records, breakout, and X-ray.

We’ll step through each of the options in the popup menu you see above:

Zoom in

There are two ways to zoom in on orders, Select-to-zoom and Auto-zoom:

Select to zoom

You can click and drag to select an area of a chart to zoom in on.

Figure 8. You can click and drag to select an area of a chart, and Metabase will zoom in on the values in that selected area.
Figure 8. You can click and drag to select an area of a chart, and Metabase will zoom in on the values in that selected area.

Auto-zoom

You can left-click to bring up the action menu, and select Zoom in and Metabase will create a “close-up” of the data surrounding the value you selected.

Figure 9. Left-click on a chart to bring up the action menu and select <strong>Zoom in</strong>. Metabase will automatically create a close-up of the data surrounding the value.
Figure 9. Left-click on a chart to bring up the action menu and select Zoom in. Metabase will automatically create a close-up of the data surrounding the value.

The Zoom in option in the action menu will choose an appropriate range of values based on the full range of values in the chart. As shown in figure 9, Zoom in also focuses on the clicked category, so only orders with products in the Doohickey category are shown. If you’d prefer a different range, or wish to include additional groups, you have the notebook editor available to fine tune your chart (and save it as a new question).

View these records

You can click on a value on a chart and select the View these orders option to bring up a table with the individual records that compose the value.

Figure 10. Clicking on a value and selecting <strong>View these orders**</strong> will bring up a table of records that compose the value.
Figure 10. Clicking on a value and selecting View these orders** will bring up a table of records that compose the value.

Breakouts

Break out by a category — this option lets us do things like see the banana cream pie orders in June 2017 broken out by the status of the customer (e.g., new or VIP, etc.) or other different aspects of the order. Different charts will have different breakout options, such as Location and Time.

Figure 11 shows an example breakout looking at orders from people.source.

Figure 11. Clicking on a value will present options to breakout the data. Different options will appear based on the data in the chart. The GIF shows a breakout by Category: <strong>User source</strong>.
Figure 11. Clicking on a value will present options to breakout the data. Different options will appear based on the data in the chart. The GIF shows a breakout by Category: User source.

X-rays

X-rays are auto-magic explorations of your data. You can click anywhere on a chart to perform an X-ray, and Metabase will generate a dashboard full of different questions about the data. You’ll have an option to save that X-ray as a dashboard, which you can then edit to your liking, by removing irrelevant questions, or adding new questions or text boxes to fill in the story you want to tell.

Figure 12. <strong>X-rays</strong> will create (a lot) of different charts based on data in your table(s).
Figure 12. X-rays will create (a lot) of different charts based on data in your table(s).

Clicking on a point or a bar additionally gives you the option to compare data, which will give you another dashboard with auto-generated charts.

If X-rays don’t make sense for your data, you can disable X-rays. Learn more about X-rays in our documentation.

Call to Action menu

Drill-through is a great way to give viewers of your questions more insight into their data, which makes it an excellent feature for delivering self-service, embedded analytics.

But drill-through is also an excellent tool for exploring your data, especially when you’re starting out with a new dataset and you’re not sure what questions you should be asking. Start with a broad query, then experiment with the options on the Action menu. When you discover an insightful cut of the data, save it as a new question, and fine tune the visualization as needed, or convert it a SQL question if you’re more comfortable with code.

To learn more about asking questions, see our documentation.