Build Your First Databricks Dashboard

Query NYC taxi data in Databricks and turn SQL results into charts.

Introduction

30 Second Summary

Every city generates mountains of data about how people move, spend, and travel. The answers are buried in those rows, but a single chart can surface a rush-hour fare spike faster than scrolling through a thousand-row spreadsheet.

In this project, you will query a real NYC taxi trip dataset using SQL inside the Databricks workspace. You will turn your query results into an interactive AI/BI dashboard with multiple chart types.

What You'll Build

Picture opening a dashboard where bar charts and a scatterplot reveal NYC taxi fare patterns that were invisible in raw query results.

By the end of this project, you'll have:

  • Bar charts that show hourly fare trends and let you compare pickup versus dropoff patterns side by side.
  • A scatterplot that reveals the relationship between trip distance and fare amount at a glance.
  • A SQL-powered dataset you defined yourself, feeding real NYC taxi data into all three charts automatically.
  • An optional Secret Mission to push your skills further.

Are there any prerequisites?

This project assumes you already have a Databricks Free Edition account set up. You should be comfortable writing SQL queries that use SELECT, WHERE, GROUP BY, and aggregate functions.

Before We Start

Before we dive in, let's lock in what you're about to build and why it matters. This is your moment to commit to the project before any hands-on work begins.

Find Your Way Around the Databricks Workspace

Your Databricks account is ready. Before writing any SQL, you need to know where the key tools live inside the workspace and confirm that your compute and data are accessible.

In this step, you will tour the workspace sidebar, check that your SQL warehouse is running, and verify the sample dataset exists. Once these three things are confirmed, you are ready to start querying.

In this step, get ready to:
  • Explore the workspace sidebar and locate the SQL tools.
  • Open the SQL editor and confirm your SQL warehouse is running.
  • Verify the samples catalog contains the NYC taxi data.
Explore the workspace sidebar

The Databricks workspace sidebar is your main navigation. It organizes every tool you need into sections.

  • Look at the left sidebar of your workspace. You will see top-level categories including Workspace, Catalog, and Compute.
  • Scroll down to the SQL section. This section contains SQL Editor, Dashboards, and SQL Warehouses.

What are these sidebar sections?

Catalog is where you browse databases, schemas, and tables. The SQL section groups all the tools for writing queries and building dashboards.

Everything you need for this project lives in the SQL section. You will use the SQL Editor to write queries, SQL Warehouses to run them, and Dashboards to visualize the results.

Open the SQL editor and check your warehouse

A SQL warehouse is the compute engine that executes your queries. Databricks creates one for you automatically called the Starter Warehouse.

  • Click SQL Editor in the sidebar.
  • Look at the compute dropdown near the top of the editor. It should show Starter Warehouse.
  • Confirm the warehouse status shows it is running. A green indicator appears next to the name when it is active.

What is a SQL warehouse?

A SQL warehouse is a managed compute resource that runs your SQL queries. You do not need to configure servers or install anything. Databricks handles all of that behind the scenes.

On Free Edition, you get one SQL warehouse (the Starter Warehouse). It auto-stops after 10 minutes of inactivity to conserve your compute quota, and restarts automatically when you run a query.

🙋‍♀️ Warehouse not running?

  • If the compute dropdown is empty, click it and select Starter Warehouse from the list.
  • If the warehouse shows Stopped, click SQL Warehouses in the sidebar, then click the start icon next to Starter Warehouse. Wait about a minute for it to show Running.
  • Help me get my SQL warehouse running in Databricks.
Verify the samples catalog

Your SQL editor is open and your warehouse is running. Run a quick query to confirm the NYC taxi dataset is accessible.

  • Count the rows in the NYC taxi table by pasting the following query into the editor:
SELECT COUNT(*) FROM samples.nyctaxi.trips
  • Click Run to execute the query.

You should see a single row in the results panel with a large number. This confirms the samples catalog is accessible and your SQL warehouse can query the NYC taxi data.

What is the samples catalog?

Every Databricks workspace includes a built-in samples catalog with read-only datasets for learning and testing. It is managed by Unity Catalog, Databricks' data governance layer.

The samples.nyctaxi.trips table contains real New York City taxi trip records. This is the dataset you will query and visualize throughout this project.

🙋‍♀️ Query returned an error?

  • If you see a "Table or view not found" error, make sure you typed samples.nyctaxi.trips exactly. The catalog is samples, the schema is nyctaxi, and the table is trips.
  • If the query hangs or times out, check that the compute dropdown at the top of the editor shows Starter Warehouse and that it is running.
  • Help me troubleshoot why my query against the samples catalog is failing.

Your workspace is set up and your data is confirmed. Next up, you will explore the NYC taxi dataset with SQL and discover why tables alone are not enough to spot patterns.

Explore NYC Taxi Data with SQL

Your SQL warehouse is running and the samples catalog is confirmed. Now it's time to explore the actual data you'll be building dashboards from.

Before building any visualization, you need to understand the shape and content of your data. SQL can give you precise answers to specific questions. But when you try to spot trends across hundreds of rows in a table, the patterns become invisible.

In this step, get ready to:
  • Preview the NYC taxi trip dataset to see its columns and sample values.
  • Write an aggregation query that summarizes trip patterns by day of the week.
  • Try to spot patterns from a results table and feel the limitation firsthand.
Preview the taxi trip data

The samples.nyctaxi.trips table contains real New York City taxi trip records. Before writing any complex queries, start by looking at what columns and values are available.

  • In the SQL editor, select all of the existing count query and replace it by pasting the following preview query:
SELECT
  tpep_pickup_datetime,
  tpep_dropoff_datetime,
  fare_amount,
  trip_distance,
  pickup_zip,
  dropoff_zip
FROM samples.nyctaxi.trips
LIMIT 100
  • Click Run to execute the query.

You should see 100 rows in the results panel below the editor. Each row represents a single taxi trip.

What do these columns tell you?

  • tpep_pickup_datetime and tpep_dropoff_datetime record when each trip started and ended.
  • fare_amount is the dollar amount charged for the trip.
  • trip_distance is how far the taxi traveled.
  • pickup_zip and dropoff_zip tell you where the trip started and ended.
  • LIMIT 100 restricts the output to 100 rows so the query returns quickly.

🙋‍♀️ Not seeing any results?

  • Make sure you cleared the previous count query completely before pasting. Leftover text can cause a syntax error.
  • Check the compute dropdown at the top of the SQL editor. If your SQL warehouse stopped, click the start icon next to it, wait for it to show as running, and click Run again.
  • Help me debug why my preview query isn't returning results in the SQL editor.
Write an aggregation query

Now that you know what columns are available, write a query that groups trips by day of the week and calculates totals and averages. This tells you which days are busiest and which are most expensive.

  • Select all of the preview query in the SQL editor and replace it by pasting the following aggregation query:
SELECT
  dayofweek(tpep_pickup_datetime) AS day_number,
  CASE dayofweek(tpep_pickup_datetime)
    WHEN 1 THEN 'Sunday'
    WHEN 2 THEN 'Monday'
    WHEN 3 THEN 'Tuesday'
    WHEN 4 THEN 'Wednesday'
    WHEN 5 THEN 'Thursday'
    WHEN 6 THEN 'Friday'
    WHEN 7 THEN 'Saturday'
  END AS day_of_week,
  COUNT(*) AS total_trips,
  ROUND(AVG(fare_amount), 2) AS avg_fare,
  ROUND(AVG(trip_distance), 2) AS avg_distance
FROM samples.nyctaxi.trips
WHERE fare_amount > 0 AND trip_distance > 0
GROUP BY day_number, day_of_week
ORDER BY day_number
  • Click Run to execute the query.

You should see exactly 7 rows in the results, one for each day of the week.

What does this query do?

  • dayofweek() extracts the day number from each pickup timestamp. It returns 1 for Sunday through 7 for Saturday.
  • The CASE statement converts those day numbers into readable names like Monday or Friday.
  • COUNT(*) tallies the total number of trips per day. AVG(fare_amount) and AVG(trip_distance) calculate the averages per day.
  • The WHERE clause filters out rows with zero fares or zero distances, which represent invalid or cancelled trips.
  • ROUND(..., 2) keeps the averages to two decimal places for readability.

✔️ Awesome, I've got everything!

Great. Make sure your query returned 7 rows before moving on.

ⓧ I'd like to double check the full code

Here is the full aggregation query. Compare it to what you have in the SQL editor:

SELECT
  dayofweek(tpep_pickup_datetime) AS day_number,
  CASE dayofweek(tpep_pickup_datetime)
    WHEN 1 THEN 'Sunday'
    WHEN 2 THEN 'Monday'
    WHEN 3 THEN 'Tuesday'
    WHEN 4 THEN 'Wednesday'
    WHEN 5 THEN 'Thursday'
    WHEN 6 THEN 'Friday'
    WHEN 7 THEN 'Saturday'
  END AS day_of_week,
  COUNT(*) AS total_trips,
  ROUND(AVG(fare_amount), 2) AS avg_fare,
  ROUND(AVG(trip_distance), 2) AS avg_distance
FROM samples.nyctaxi.trips
WHERE fare_amount > 0 AND trip_distance > 0
GROUP BY day_number, day_of_week
ORDER BY day_number

Not seeing 7 rows?

  • If you see 0 rows, check that the WHERE clause uses > (greater than), not >= or =.
  • If you see a syntax error, make sure every WHEN line in the CASE statement has a day name wrapped in single quotes.
  • Help me debug why my aggregation query isn't returning the expected results.
Spot the limitation in your results

Your query returned the right answers. Before reading the numbers closely, predict: do you think you can tell which day is busiest and which is most expensive at a glance?

  • Scan the 7 rows in your results table. Try to answer: which day has the most trips?
  • Now try to answer: which day has the highest average fare?

You can find the answers by reading each cell and comparing numbers across rows. But it takes real effort. Now imagine this table had hundreds of rows instead of 7. The patterns would be completely buried in the numbers.

Why is this hard?

Tables are great for looking up a specific value. They are terrible for comparing many values at once. Your brain has to hold numbers in short-term memory, jump between rows, and mentally rank them.

A chart does that comparison for you visually. The tallest bar wins. This friction between precise-but-hard-to-read tables and instant-but-approximate charts is exactly the problem dashboards solve.

Your SQL queries return the right answers, but tables hide the patterns. Next up, you'll build an AI/BI dashboard that turns those same numbers into charts where the trends jump off the screen.

Build Your First AI/BI Dashboard

In the last step, your SQL queries returned precise answers about NYC taxi trips. You could read the numbers row by row, but spotting trends across seven days of data already felt tedious.

A dashboard turns those same numbers into visual patterns anyone can read in seconds. In this step, you will create an AI/BI dashboard inside Databricks and build three charts that make fare trends and trip patterns jump off the screen.

In this step, get ready to:
  • Create an AI/BI dashboard and define a SQL dataset.
  • Build a bar chart showing fare trends by hour.
  • Clone the chart and add a scatterplot to complete the dashboard.
Create a new dashboard and define your dataset

Every AI/BI dashboard starts with a dataset. The dataset is a SQL query that feeds every chart on the dashboard. You will create a new dashboard, then define a dataset that pulls clean NYC taxi trip data.

  • Click New in the left sidebar.
  • Select Dashboard.

Your new dashboard opens as a draft. You will see two areas at the top: a Data tab and a canvas page tab.

  • Click the Data tab in the upper-left corner.
  • Click Add SQL dataset.
  • Paste the following query into the dataset editor:
SELECT
  tpep_pickup_datetime,
  tpep_dropoff_datetime,
  fare_amount,
  pickup_zip,
  dropoff_zip,
  trip_distance,
  CASE dayofweek(tpep_pickup_datetime)
    WHEN 1 THEN 'Sunday'
    WHEN 2 THEN 'Monday'
    WHEN 3 THEN 'Tuesday'
    WHEN 4 THEN 'Wednesday'
    WHEN 5 THEN 'Thursday'
    WHEN 6 THEN 'Friday'
    WHEN 7 THEN 'Saturday'
  END AS day_of_week
FROM samples.nyctaxi.trips
WHERE trip_distance > 0
  AND trip_distance < 10
  AND fare_amount > 0
  AND fare_amount < 50

What does this query do?

It pulls the same taxi trip columns you explored in Step 2, plus a day_of_week label using the same CASE logic from your aggregation query.

The WHERE clause filters out outliers: only trips under 10 miles and fares under $50 make it through. This keeps your charts clean and readable instead of being skewed by a handful of extreme values.

  • Click Run to execute the query.

A table of results appears below the query. This dataset powers every chart you build on this dashboard.

Not seeing any results?

  • Check that your SQL warehouse is still running. Click SQL Warehouses in the sidebar and confirm the status shows Running.
  • Double-check that you pasted the full query, including the WHERE clause at the bottom.
  • Help me troubleshoot why my dashboard dataset query returns no results.
Build your first bar chart

With your dataset ready, it is time to turn those rows into a visual. Your first chart will show how fare amounts change throughout the day based on dropoff times.

  • Click the canvas page tab (labeled Untitled page) to switch to the dashboard canvas.
  • Click Add a visualization and use your mouse to place the widget on the canvas.

A blank chart appears on the canvas. The configuration panel opens on the right side of the screen with your dataset automatically selected.

  • In the configuration panel, click the plus icon next to the X-axis and select tpep_dropoff_datetime.
  • Click the field name to view additional options, then select the HOURLY transform.
  • Click the plus icon next to the Y-axis and select fare_amount.

The default visualization type is Bar chart. You should see a bar chart showing how fare amounts vary by hour of the day.

What is the HOURLY transform?

Raw timestamps would plot every individual trip as its own data point. The HOURLY transform groups all trips into one-hour buckets, so each bar represents a full hour of the day.

This reveals time-of-day patterns that individual rows would hide.

🙋‍♀️ Seeing a blank chart?

  • Confirm your X-axis is set to tpep_dropoff_datetime and your Y-axis is set to fare_amount.
  • Check that the HOURLY transform is selected. Without it, the chart may try to plot too many individual timestamps and appear empty.
  • Help me figure out why my bar chart is blank.
Clone the chart and add a scatterplot

One chart down, two to go. You will create a second bar chart by cloning the first one, then add a scatterplot to reveal a different kind of pattern.

  • Right-click on your bar chart on the canvas.
  • Click Clone.

A duplicate chart appears below the original with the same configuration.

  • Click the cloned chart to select it.
  • In the configuration panel, change the X-axis to tpep_pickup_datetime (keep the HOURLY transform).
  • Use the Color selector to choose a different color so you can tell the two charts apart.

You now have two bar charts side by side. One shows fare patterns by dropoff hour, the other by pickup hour.

  • Click Add a visualization again to add one more chart to the canvas.
  • In the configuration panel, change the Visualization dropdown to Scatter.
  • Set the X-axis to trip_distance.
  • Set the Y-axis to fare_amount.

The scatterplot reveals the relationship between how far a trip goes and how much it costs. Each dot is a single trip.

  • Arrange all three charts on the canvas by dragging and resizing them so they are all visible at once.

Why clone instead of building from scratch?

Cloning copies all of the original chart's settings, including the dataset, axis transforms, and chart type. You only need to change the one field that differs. This saves time and reduces mistakes compared to configuring everything from scratch.

Before you admire your finished dashboard, take a moment. What patterns do you expect to see across these three charts? Do you think pickup and dropoff fare trends will look the same or different?

Your dashboard now displays three visualizations: two bar charts showing fare patterns by dropoff and pickup hour, and a scatterplot of trip distance versus fare amount. The same patterns that were buried in your tabular results from Step 2 are now immediately visible.

Charts not displaying correctly?

  • If a chart shows no data, click the chart and verify your dataset is selected in the configuration panel.
  • If the scatterplot looks like a bar chart, check that the Visualization dropdown is set to Scatter and not Bar.
  • If charts overlap, drag and resize them on the canvas until all three are visible.
  • Help me fix my dashboard charts.

Your dashboard is live and full of insights. Next up, take on an optional Secret Mission where you let AI build a chart for you.

Secret mission

Ask Genie Code to Build a Chart

You've built three charts by hand, configuring axes and chart types one click at a time. What if you could skip all that and just describe what you want in plain English? In this secret mission, you'll use Genie Code to generate a chart from a natural language prompt.

Clean Up Your Resources

Clean Up Your Resources

This project runs entirely on Databricks Free Edition, so there are no ongoing billing charges.

Decide whether to keep your resources as they are, conserve your daily compute quota, or delete your dashboard entirely.

What about compute quota?

Your SQL warehouse compute usage counts against your Free Edition daily quota, but there is no billing.

If the daily quota is exceeded, compute resources shut down for the rest of the day. Your data and settings are preserved.

Resources you used:

  • One AI/BI dashboard saved as a draft in your workspace.
  • SQL queries saved in the SQL editor.

Keep everything running

No action needed. Choose this if you plan to keep exploring your dashboard or building on it.

  • Your dashboard draft is auto-saved in your workspace. You can return anytime and pick up where you left off.
  • The SQL warehouse auto-stops after 10 minutes of inactivity, so it will not consume quota while idle.
  • Your SQL queries remain in the SQL editor for future use.

Pause - I'll come back to this later

Stop your SQL warehouse immediately to preserve your daily compute quota. Your dashboard and queries are unaffected.

  • Click SQL Warehouses in the sidebar.
  • Click the stop icon next to your warehouse to stop it right away rather than waiting for auto-stop.
  • Your dashboard draft and SQL queries are preserved. When you come back, start the warehouse again and everything will be ready.

Delete - I don't want to use this again

Remove your dashboard if you want a clean slate.

  • Click Dashboards in the sidebar.
  • Right-click your dashboard and select Move to Trash.
  • Your SQL editor queries remain in your workspace and do not need to be deleted.

Nice Work!

Nice Work!

Nice work! You just built an interactive analytics dashboard powered by real NYC taxi trip data, entirely inside the Databricks workspace.

You went from raw rows to visual insights that anyone can read in seconds.

You've learned how to:

  • Query the samples.nyctaxi.trips dataset with SQL to preview raw trip data and aggregate patterns by day of week.
  • Build an AI/BI dashboard with two bar charts showing hourly fare trends and a scatterplot revealing the relationship between trip distance and fare amount.
  • Navigate the Databricks workspace including the SQL Editor, SQL Warehouses, Catalog, and the Dashboard builder.
  • Completed an optional Secret Mission to push your skills further.

Ready to quiz yourself?