Before writing a query you need exact names: customer__country, not country. The list commands read the semantic manifest and print what exists and what each metric can be grouped by, including dimensions reached through joins.

Copy and paste

dbt sl list metrics                                   # all metrics with their dimensions
dbt sl list dimensions --metrics revenue              # what revenue can be grouped by
dbt sl list dimensions --metrics revenue,signups      # only what both have in common
dbt sl list dimension-values --metrics revenue --dimension customer__country
dbt sl list entities --metrics revenue
dbt sl list saved-queries --show-exports

With dbt Core, the same commands start with mf list. To find metrics by name with mf:

mf list metrics --search ytd
mf list metrics --search revenue_ytd --show-all-dimensions

Dimensions of a metric

mf list dimensions --metrics revenue,signups
• customer__country
• customer__segment
• customer__signup_date
• metric_time

Alone, revenue (on orders) can use order dimensions, customer dimensions and, two hops away, the region of the customer’s country. signups (on customers) can’t reach orders, so the list for both metrics only contains what they share. That is the set a BI tool can offer when the two metrics sit in the same chart.

Values of a dimension

mf list dimension-values --metrics revenue --dimension customer__country
• DE
• IT

The values come from the data, through the metric: France has customers but no orders, so it isn’t listed for revenue. This is the command BI tools use to fill filter dropdowns; --start-time and --end-time limit the period it looks at.

All metrics

dbt sl list metrics prints each metric with the first few dimensions and “and N more”. Add --show-all-dimensions with mf to see them all. The list is also a check that the YAML was picked up: a metric that is missing here was not parsed, usually because its file is outside model-paths or the parse failed.

Where the names come from

When a query fails with “does not match any of the available group-by-items”, the error suggests names from the same list; see how to fix “metric not found” or “dimension not found”.

Tested with dbt Core 1.12 and MetricFlow 0.213 on DuckDB; the dbt sl options come from the dbt documentation.

References