Week 11 - Dashboarding

Introduction to Dashboarding

Metabase Setup

Dashboards in Metabase

Streamlit Fundamentals

Building a Metrics Dashboard

Presenting Metrics

Practice

Gotchas & Pitfalls

Assignment: Build Two Dashboards

Slides (PDF)

Career relevance: Week 11

Glossary: Week 11

Going Further

History of Dashboarding

Going Further

This page is optional. Nothing here is required for Week 11's learning goals or the assignment.

Use these resources to go deeper on Metabase, Streamlit, or metric definitions after the assignment is complete.


Full courses and tutorials


Deep dives on specific topics


Community and practice


Books


Adding dashboard date filters in Metabase

If you want to add interactive date filters to a Metabase dashboard where the questions are built with raw SQL queries, you cannot just drag-and-drop a filter chip. Since SQL queries are native blocks of code, Metabase does not automatically know how to apply filters to them.

To make this work:

Step 1: add a template variable to the SQL. Edit your SQL query and define a variable, using the double-brace {{variable_name}} syntax:

SELECT pickup_borough, COUNT(*) AS trip_count 
FROM nyc_taxi_reference.fct_trips 
-- A template variable must stand alone, Metabase replaces it with the full clause:
WHERE {{pickup_date}} 
GROUP BY pickup_borough

Step 2: configure the variable type as a Field Filter. In the right-hand variables panel of the query editor, click your variable. Change its Variable type to Field Filter, map the Field to filter to the matching column in the database (e.g. team1.nyc_taxi_reference.fct_trips.pickup_datetime), and save the question.

Step 3: add the filter to the Dashboard. Open your dashboard, click Edit, then click Add a filter → Date picker → Date range. Click the filter chip, then map it to the Question card by selecting the pickup_date field filter variable, and save the dashboard.

(For a full guide, see the Metabase Field Filters documentation.)


The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0 *https://hackyourfuture.net/*

CC BY-NC-SA 4.0 Icons

Built with ❤️ by the HackYourFuture community · Thank you, contributors

Found a mistake or have a suggestion? Let us know in the feedback form.