Skip to Content
DashboardsLearnBuild your first dashboard

Build your first dashboard

For: implementers. Setup: ModularIoT (the web app at modulariot.com/app).

You will learn to:

  • create a dashboard and add a widget;
  • write a SQL query that returns one row with a number per state;
  • show those numbers in a Stacked Stat (KPI per state + 100% bar);
  • show the detail in a table;
  • filter the table with a select filter;
  • share the dashboard.

The result is a dashboard of requests: at the top, how many are in each state; below, the list. It takes about 30 minutes.

Before you start

You needWhyIf you do not have it
Dashboards in the navigationIt is where dashboards are createdAsk an administrator to turn it on (Deploy with ModularIoT)
The Contributor dashboard role or higher (roles)With the Consumer role you can only view dashboardsAsk an administrator for the role
The organization Owner role, to save SQL queriesAdministrators can read and run queries, not save themAsk an Owner to save the queries of steps 3 and 5
A BigQuery connection with a service accountTo write the SQL queriesSteps 1 and 2 work without it. See Connect BigQuery

The example uses a solicitudes (requests) table with these columns. Replace the names with your table’s.

ColumnTypeExample
idSTRINGS-1042
estado (state)STRINGpendiente, en_curso, cerrada
responsable (owner)STRINGNorth team
creada_en (created at)TIMESTAMP2026-10-01 09:30:00

Create the dashboard

  1. Open Dashboards in the navigation.
  2. Select Create Dashboard.
  3. In Name, type Requests and select Create.

The dashboard opens empty, with an Add Widget button in the middle. Changes save on their own a few seconds after each edit.

Add a Stacked Stat with fixed data

Start with numbers typed by hand to see the widget before connecting data.

  1. Select Add Widget, type Stacked in the search box and choose Stacked Stat. The widget appears with sample data (“Traffic Sources”).

  2. Turn on Edit Mode at the top right. From now on the button to add widgets is under the grid.

  3. Hover over the widget and open its settings (the gear).

  4. In the Visualization tab:

    • Chart Type: Bar. Donut draws a ring with the same parts.

    • Title: Requests by state.

    • Unit: delete the default %.

    • Categories: the widget comes with four sample categories. Change the first three and delete the fourth with the trash icon. Pick each color with the row’s color circle:

      LabelValueColor
      Pending12yellow
      In progress7blue
      Closed30green
  5. Select Save at the bottom of the panel.

The widget shows a bar split in three parts, proportional to 12, 7 and 30, and a legend with each number. The widget does not change while you edit its settings; you see the change when you save.

Pitfall: if you do not delete the % in Unit, the legend shows 12%. The Esc key does not close the color picker: it opens the unsaved changes dialog. Choose Keep editing.

Write the summary query

A Stacked Stat reads one row: the first row the query returns. Each category reads one column of that row. So the query turns the states (rows) into columns.

  1. Go to Settings › Connections and open BigQuery, under Editors.

  2. Choose your connection in Connection and select + New.

  3. Write the query:

    SELECT COUNT(*) AS total, SUM(CASE WHEN estado = 'pendiente' THEN 1 ELSE 0 END) AS pendiente, SUM(CASE WHEN estado = 'en_curso' THEN 1 ELSE 0 END) AS en_curso, SUM(CASE WHEN estado = 'cerrada' THEN 1 ELSE 0 END) AS cerrada FROM `my-project.operations.solicitudes`
  4. Select Run. You should see one row:

    totalpendienteen_cursocerrada
    4912730
  5. In Query settings, under the editor, change Name to resumen_estados and select Save.

Only SELECT queries can be saved. Under the editor, Will read shows how many bytes the query will read. A query saved here appears right away as an Operation of that connection in the organization’s dashboards.

Try it without your own table. Replace the FROM with this sample table. It generates 49 requests and reads 0 bytes:

WITH solicitudes AS ( SELECT FORMAT('S-%04d', n) AS id, CASE WHEN n <= 12 THEN 'pendiente' WHEN n <= 19 THEN 'en_curso' ELSE 'cerrada' END AS estado, CASE MOD(n, 3) WHEN 0 THEN 'North team' WHEN 1 THEN 'South team' ELSE 'Central team' END AS responsable, TIMESTAMP_SUB(TIMESTAMP '2026-10-30 12:00:00', INTERVAL n * 7 HOUR) AS creada_en FROM UNNEST(GENERATE_ARRAY(1, 49)) AS n ) SELECT COUNT(*) AS total, SUM(CASE WHEN estado = 'pendiente' THEN 1 ELSE 0 END) AS pendiente, SUM(CASE WHEN estado = 'en_curso' THEN 1 ELSE 0 END) AS en_curso, SUM(CASE WHEN estado = 'cerrada' THEN 1 ELSE 0 END) AS cerrada FROM solicitudes

Use the same WITH solicitudes AS (…) at the start of the detail query in step 5.

Connect the widget to the query

A dashboard uses a query through a saved query: a short name that widgets choose.

  1. Go back to the dashboard. With Edit Mode on, open the dashboard settings menu (the gear next to Edit Mode) and choose Saved queries.

  2. Select Add query and fill in:

    • Result name: resumen.
    • Connection: your BigQuery connection.
    • Operation: resumen_estados.
    • Parameters (JSON): {}.
  3. Select Apply to draft. This adds the query to the dashboard. The dashboard saves on its own; there is no publish step. Close the menu by clicking outside it.

  4. Open the Stacked Stat settings. In the Data Provider tab, set Data Source to Planner and choose resumen in Variable. The available columns appear below: total, pendiente, en_curso, cerrada.

  5. In the Visualization tab, replace each category value with a template that names the column:

    LabelValue
    Pending{{pendiente}}
    In progress{{en_curso}}
    Closed{{cerrada}}
  6. Change Title to Requests by state ({{total}}) and select Save.

The widget shows the real numbers. {{column}} is replaced by that column’s value in the first row.

Stacked Stat titled Solicitudes por estado (49) with the legend Pendiente 12, En curso 7, Cerrada 30

Pitfall: if the widget shows Error: Could not load query results right after you add the saved query, reload the page. The server runs the query from the saved dashboard, and autosave takes a few seconds.

Data Source options:

OptionThe widget reads
PlannerA saved query of the dashboard, chosen in Variable
Static (JSON)Data typed into the widget itself

Add the detail table

A table reads all the rows of its query. One query row is one table row.

  1. In Settings › Connections › BigQuery, create another query, detalle_solicitudes:

    SELECT id, estado, responsable, FORMAT_TIMESTAMP('%Y-%m-%d %H:%M', creada_en, 'America/Santiago') AS creada_en FROM `my-project.operations.solicitudes` WHERE (IFNULL(@estado, '') = '' OR estado = @estado) ORDER BY creada_en DESC LIMIT 500
  2. Under Parameters, a Declare @estado button appears. Select it. The parameter gets type STRING.

  3. Leave Test value empty and select Run. All states come back: the query receives NULL and IFNULL treats it as empty.

  4. Type en_curso in Test value and run again. Only those rows come back.

  5. Save the query.

  6. In the dashboard, add a saved query:

    • Result name: detalle.

    • Connection: your BigQuery connection.

    • Operation: detalle_solicitudes.

    • Parameters (JSON):

      { "estado": { "kind": "filter", "key": "estado", "defaultValue": "" } }
  7. Select Add Widget and choose Data Table V2.

  8. In its settings, Data Provider tab, set Data Source to Planner and Variable to detalle. The available columns appear below.

  9. In the Visualization tab, check Columns: the sample columns are replaced by Id, Estado, Responsable and Creada En. Change Title to Request detail and select Save.

If Columns still shows the sample columns (Vehicle, Client…), the query had not run yet. Save, reload the page and choose detalle in Variable again.

FORMAT_TIMESTAMP turns the date into text. Without it, the table shows a BigQuery TIMESTAMP as a number (1.7933364E9).

@estado is a BigQuery parameter. The binding {"kind": "filter", "key": "estado"} gives it the value of the estado filter, which you create in the next step. While the filter is empty, the server sends defaultValue (""). The condition IFNULL(@estado, '') = '' then lets every row through.

Pitfall: a BigQuery query always receives all its parameters. Do not use omitWhenEmpty with BigQuery: if the parameter is left out, the query fails. Use defaultValue.

Filter the table by state

  1. Open the dashboard settings menu and choose Filter Bar.

  2. Select Add filter and fill in:

    • Filter type: Select.

    • Display label: State.

    • Parameter key: estado. It must match key in the query binding. If left empty, it is derived from the label.

    • Turn on Allow a single selection.

    • Options source: Manual (typed by hand).

    • Options: select Add option three times. Label is what the user sees; Value is what the query receives:

      LabelValue
      Pendingpendiente
      In progressen_curso
      Closedcerrada
  3. Select Save in the panel.

  4. Turn off Edit Mode. The filter appears above the widgets as a State button.

Open State and choose In progress. The table reloads and shows 7 rows. The page address changes to ?estado=en_curso; you can share that link with the filter applied. The Stacked Stat does not change because its query does not bind the estado filter. The summary always shows every state.

Dashboard with the filter Estado: En curso, the Stacked Stat with the three states and the table with 7 in-progress rows

Clicking a part of the Stacked Stat bar does not filter the table. The filter bar is the way to do it.

Share the dashboard

  1. Open the settings menu and choose Access Control.
  2. Select Manage permissions.
  3. Find your colleague under Users, choose the Reader role (Consumer) and select Add.

Your colleague can open the dashboard and use the filter, but cannot change it. To let them edit, give them Editor. In the UI, Reader, Contributor, Editor and Administrator are the roles Consumer, Contributor, Editor and Coordinator.

What you built

PieceReadsQuery shape
Stacked StatThe first row of resumenOne row, one column per state
Data Table V2All rows of detalleOne row per request
estado filter—Gives a value to the @estado parameter

Next steps

Last updated on