Use metric views with external BI tools
You can query Unity Catalog metric views from external BI tools through any SQL-based connection. This page describes the connection patterns and the trade-offs between them, so you can pick the right approach for each tool. After you choose an approach, follow the linked pages for the configuration steps and limitations.
Choose an approach
The following table describes the connection patterns for querying a metric view from a BI tool.
Pattern | When to use |
|---|---|
The tool passes SQL queries to Databricks (for example, using a native query or custom SQL option). Most BI tools support this approach. | |
You want to avoid writing SQL in the BI tool. You define a standard view that wraps the metric view with the | |
The tool can't pass custom SQL queries to Databricks and instead generates standard aggregations ( | |
The partner has added built-in support for metric views, so measures and dimensions appear directly in the tool without custom SQL. |
Query a metric view using custom SQL
All measure evaluations in a metric view query must use the MEASURE aggregate function (or its AGG alias in Databricks Runtime 18.1 and above). You must list each column explicitly because SELECT * is not supported. The following query is the canonical pattern and works with any BI tool that supports SQL pass-through:
SELECT
`Order Month`,
MEASURE(`Total Revenue`),
MEASURE(`Order Count`)
FROM main.sales.orders_metric_view
GROUP BY ALL;
For additional query patterns, including filtering and joining metric view results with other tables, see Query metric views.
Query a metric view through a wrapper view
If you don't want to write SQL in the BI tool, define a standard view in Unity Catalog that wraps the metric view with the MEASURE() pattern. The view embeds the measure logic, so the BI tool can query it like any other table without custom SQL. This works with any tool that can connect to a Unity Catalog table, including Power BI.
CREATE VIEW main.sales.orders_report AS
SELECT
`Order Month`,
MEASURE(`Total Revenue`) AS `Total Revenue`,
MEASURE(`Order Count`) AS `Order Count`
FROM main.sales.orders_metric_view
GROUP BY ALL;
Point the BI tool at the wrapper view (for example, main.sales.orders_report) and query it directly. Because a standard view defines a fixed set of dimensions, create a wrapper view for each combination of dimensions your reports need.
Tool-specific guidance
The following table summarizes the recommended approach for common BI tools.
Tool | Recommended approach |
|---|---|
Use the Databricks Power BI connector's Native query option with the | |
Use Tableau's Custom SQL connection option with the | |
Use a Sigma dataset backed by custom SQL with the | |
Other JDBC or ODBC tools | Use the |
Built-in partner integrations
Some partners are adding built-in support for Unity Catalog metric views so that measures and dimensions appear directly in the tool without writing custom SQL. As partners release these integrations, they are documented on the partner pages under Connect to BI partners using Partner Connect.