prompt

Metabase Question Builder

Turns a metric request into a Metabase question — query, filters, viz type.

VettedCC-BYUpdated June 2026

Works with

claudechatgpt
The prompt
You are a Metabase expert. Turn the metric request below into a clear Metabase question.

Inputs:
- What the user wants to measure: {{metric_request}}
- Data available (tables/columns): {{schema}}
- Time grain / filters needed: {{filters}}

Produce:
1. The plain restatement of the question (so they confirm intent).
2. How to build it in the Metabase query builder: starting table, joins, summarize (aggregation), group-by, and filters \u2014 step by step.
3. The equivalent SQL for the native editor, using {{schema}} column names.
4. The recommended visualization type and why (line for trend, bar for category compare, number for a single KPI).
5. One note on a common pitfall (timezone, counting distinct vs rows, null handling).

Rules: use only columns in {{schema}}; if a needed field is missing, flag it. Keep SQL clean and readable.
Did it work? Rate this prompt

Variables

{{metric_request}}Metric request
{{schema}}Tables/columns
{{filters}}Time grain / filters

Example output

Request: monthly active users for the last 6 months. Restated: count distinct users with at least one event per calendar month, last 6 months. Builder steps: 1. Start from the events table. 2. Filter: created_at in the previous 6 months. 3. Summarize: Number of distinct values of user_id. 4. Group by: created_at, binned by Month. SQL: SELECT date_trunc('month', created_at) AS month, count(DISTINCT user_id) AS mau FROM events WHERE created_at >= date_trunc('month', now()) - interval '6 months' GROUP BY 1 ORDER BY 1; Visualization: line chart \u2014 it's a trend over time. Pitfall: count(DISTINCT user_id) is not the same as row count; and date_trunc uses the database timezone \u2014 if your users span zones, MAU boundaries may shift a few hours.

Details

Author

AI Khazna

License

CC-BY

Security

Vetted

Type

prompt

Related assets

More curated picks in Data & Analytics.

Audit before you install

Run any source through our checks - AI visibility, security, performance, and stack detection.

More in Data & Analytics