These are the docs for the Metabase master branch. Some features documented here may not yet be available in the latest release. Check out the docs for the latest version, Metabase v0.56.
Progress bars
Progress bars are for comparing a single number to a goal value that you set.
When to use a progress bar
Progress bars are useful when you want to show the movement of a metric toward a goal, like assessing performance of a KPI, or tracking the percentage of of completion on a project.
Progress bars give you an option to set up an alert whenever the result of a question reaches the goal set in the progress bar settings. See Progress bar alerts.
Data shape for the progress bar
To create a progress bar you’ll need:
-
A query that returns a single row with one or more numeric columns, like “Sum of order quantity”. Progress bars don’t work with breakouts.
Sum of Quantity Average Quantity Max Quantity 4910 17.32 173 -
A goal value. The goal value can be a positive number or a value from another column in the same query, see Set progress bar goal.
The goal is set in the chart options.
Create a progress bar
Once you built the query that returns data in the appropriate shape, you can create a progress bar:
-
Visualize the query results.
By default, Metabase might display results as a table or a number, but you can switch the visualization type.
-
While viewing a visualization, click the Visualization button in the bottom left of the screen and switch visualization to Progress.
- To set the bar’s goal and metric, click the gear icon in the bottom left to open the settings sidebar.
-
In the “Display” bar in the settings sidebar, choose the column to use as a metric and the column or number to use as a goal. See Set a goal.
If your query only returns one number, you’ll only be able to set a constant goal.
Set goal for a progress bar
You can set a constant goal (e.g., 5000) or a custom goal based on another column.
Use a constant goal
To set a constant goal for the progress bar:
- While viewing the progress bar, click the Gear icon in bottom left to open settings.
-
On the display tab, click the Goal dropdown and select Custom value.
If your query result contains only a single column, you won’t see the column dropdown, and instead you’ll just see a field to enter your constant goal.
- Enter the goal value.
Use another column as the goal
The custom goal has to come from a column in the same query, so your query has to return the result in the form of:
Value | Goal |
---|---|
4910 | 5000 |
If you’re using the query builder, you might need to compute both the metric and the goal as aggregations, so custom aggregations might be handy.
For example, if you want to build a progress bar comparing count of orders this year (the metric) vs count of orders last year (the goal) you can make use of CountIf()
to build a query returning conditional counts based on years:
Once you have a column that you want to use, set it as a goal:
- While viewing the progress bar visualization, click on the Gear icon in bottom left to open settings.
- On the display tab, select the columns you want to serve as the value and the goal.
Use another query’s result as the goal
To use the result of another query as the goal value for the progress bar, you’ll first need to bring this value into your query as a column, then select that newly added column as the goal value in progress bar settings. In the query builder, you can bring in a result from another question using a join on 1=1
:
- Create a separate question returning a single number: your dynamic goal.
- Create a new question. This question should return the metric you want to compare to the goal. This is the question you’ll visualize as a progress bar.
-
Join this question to the question containing your dynamic goal from step 1. Join the question using a custom expression
1
for both sides of the join. See joins with custom expressions.This join should add the dynamic goal as a new column to your query.
- Set the visualization to a progress bar and set the dynamic goal column as the goal.
Progress bar options
To open the chart options, click on the gear icon at the bottom left of the screen.
Format options will apply to both the result of the query and the goal value:
Selecting “Style: Percent” in format options will only change how the result of the query is formatted: for example, 17
will be formatted as 1700%
. If you instead want to display the query result as a percentage of the goal, you’ll need to calculate that percentage in your query. For example, to display the count of orders as a percentage of the goal of 20
, use custom expressions to return “Count of orders divided by 20”, and format the result as a percentage.
Progress bar alerts
You can tell Metabase to send alerts when the progress bar goes above or below the goal. See progress bar alerts.
Limitations and alternatives
-
Progress bars assume that your objective is to increase a metric. If the objective is to decrease or reduce a metric, consider using the gauge chart.
-
Progress bars don’t support breakouts. If you’d like to display progress of a metric towards a goal across a breakout, consider using a bar or line chart with a goal line.
Further reading
Read docs for other versions of Metabase.