Skip to main content

Driving Trusted Insights With AI/BI and Unity Catalog Metric Views

Summary

  • Metric-driven analytics: Unity Catalog metric views enable organizations to define reusable business metrics with standardized definitions, ensuring consistent interpretation across analytics, AI/BI Dashboards, and Genie Spaces.
  • Governance and performance: Implement governance through unified metric definitions that manage business semantics effectively, while improving query performance through pre-aggregated metric views that accelerate insights.
  • Self-service analytics: Empower business users with self-service analytics by abstracting complex data joins and aggregations behind well-defined metric views that maintain data accuracy and consistency.

Driving Trusted Insights With AI/BI and Unity Catalog Metric Views

Watch: Driving Trusted Insights With AI/BI and Unity Catalog Metric Views
Talk by Fuat Can Efeoglu, Sr. Staff Product Manager, Databricks
Deliver trusted, high-performance insights by incorporating Unity Catalog metric views and business semantics into your AI/BI workflows. this video dives into the architecture and best practices for defining reusable metrics, implementing governance and enhancing query performance in AI/BI Dashboards and Genie. Learn how to manage business semantics effectively to ensure data consistency while empowering business users with governed, self-service analytics. Ideal for teams looking to streamline analytics at scale, this video provides practical strategies for driving data accuracy and governance.
Intelligent analytics for everyone: https://www.databricks.com/product/business-intelligence
BI meets AI: https://www.databricks.com/resources/ebook/business-intelligence-meets-ai
Explore the only unified platform for agent systems: https://www.databricks.com/product/artificial-intelligence
See all the product announcements from Data + AI Summit: https://www.databricks.com/events/dataaisummit-2025-announcements

Chapters

FAQs

What are Unity Catalog metric views?

Metric views are reusable, governed definitions of business metrics that live in Unity Catalog. They standardize how metrics like revenue or customer count are calculated, ensuring consistency across all analytics and AI tools.

How do metric views improve performance?

Metric views provide pre-aggregated data and standardized definitions that optimize query performance. Rather than recalculating metrics each time, AI/BI and Genie can leverage these pre-computed, optimized definitions.

How can AI know which definition of a metric to use?

Metrics like revenue or customer churn often have multiple valid definitions depending on context (e.g., gross vs. net revenue, different customer segments). This video explains how Unity Catalog Metric Views provide AI with a governed, centralized source of truth for metrics. When an AI/BI system needs to answer a question involving revenue, it retrieves the official metric definition, calculation logic, and relevant dimensions from the Databricks Data and AI platform instead of guessing or accepting ambiguous input. This ensures consistent analysis and prevents expensive mistakes from conflicting metric definitions.

How can I get AI to know my own business terms?

AI systems must understand business context and terminology to provide accurate analysis. This video demonstrates how Unity Catalog enables you to capture your company's business terms, metric definitions, and data semantics in a governed repository. When integrated with AI/BI tools on the Databricks Data and AI platform, these definitions become available to AI models, so they understand what "active users" means in your company, how you calculate profitability, and which dimensions apply to which facts. This transforms AI from a generic tool to one trained on your organization's specific business language.

How do they support self-service analytics?

By abstracting complex joins and aggregations behind metric definitions, business users can work with high-level business concepts rather than raw data. This empowers self-service analytics while maintaining data quality and governance.

Full transcript

0:00 Introduction to metrics

All right. Hey all, is the volume good? Okay, awesome. Nice to see you all. Name is spelled CN but pronounced. Um, I'm one of the product managers here at Data Bricks. looking over a few different efforts we have um including Unity Unity catalog metrics. Um and today I kind of wanted to take you all over like what Unity catalog metrics are and then like what kind of use cases you can expect to see with them on AIBI and how to kind of think about like a workflow in that regard.
So just to as a quick reminder to all of you, you know, some of the stuff here that we showed today might change, but you know, a lot of the things I'm going to be showing you to are already in public preview. So that only applies to the road map items. So I'll I'll take a quick give you a quick intro about why we're doing this in the first place and then kind of get into what we're doing. So as you all know right we have tons of different tables tons of different types of data tons of different kind of levels and quality of data you know you'll have staging tables you have aggregation tables you have data with customer data that you just integrated into your data lakeink but what you need is a way from to be able to go from these data sets to insights and insights you know for some use cases are kind of defined as business metrics.

1:06 Data management challenges

So what's a business metric? A business metric is basically you being able to know where you're for a certain given business question. You you having the understanding of where does this data live, what data sets do I need to join, what aggregations do I need to do, what filters I need to apply, right? and what kind of semantics I need to tell my users so that they can correctly use this asset as if they kind of understand all the things I told you about without actually understanding all the you know backend data uh pipelines and fundamentals.
So kind of thinking about how to you know reason about this right you start with a question right let's say the question is what is revenue per active customer from that question you kind of need to decide what these things means in your business terms right what is my revenue what is active customers which data sources do these things live in how do I join to get to the right kind of definition and once you decide that right what's once you decide okay here's my you know revenue by active customer definition then you need to kind of understand okay so what is my business going to use this metric in are they going to analyze it by region?
Are they going to look at it by business units? Are they going to look at it by 50 other things in reality, right? You're going to have many dimensions to kind of look at. And when you're trying to implement this, you have a bunch of options today, right? What you can do is you can create a bunch of tables or views, right? You can have like an active monthly activives, daily activives, like yearly activives tables kind of representing these different levels and create them as different assets. you can put them as in a dashboard with the certain queries so that the logic for your KPI lives in the widget.
So you can have widget that describes your revenue or active customers, right? So that would also work. That's an option. And finally, what you can do is you can kind of try to put this in a you know in an LLM ccentric application like a chatbot with the you know you can say hey here's how you calculate revenue. Here's a function to calculate active customers. Uh and that will also work. But the problem with a lot of these approaches is one they end up isolating your logic across the board, right?
So stuff isn't like your rigid, it lives in your genie prompts, it lives in your tables and many many of those by the way, right? So that's one. So you're kind of siloing your definitions. The second big one here is the moment you end up creating all these different tables and views, you end up with like a table per question nearly, right? So now as an analyst when I come in and I'm trying to answer a question I have to do okay so to answer this question what tables do I need what tables do I need to join how am I going to exactly do the filtering on it right it becomes like a larger like decision tree and what you're saying is you can do better than this right what if in unity catalog we give you a way to centralize your metric definitions right a metric definition being your data model your measures and dimensions all the other semantic metadatas things like display names synonyms um formatting, right?

4:06 Unity Catalog architecture

Whether something is currency or like you know percent, all of that information into a bundle and govern that alongside all your data assets, right? Next to your tables, next to your kind of views, next to your schemas, you now have this thing called a metric view. A and a metric view basically is a place where you define your organization's metrics in one place, govern them, establish reliability, certify them so that you can kind of say hey when someone searches they see hey this is revenue certified by this data central data person or this line of business right and then finally make it available in a consistent reliable and repeatable fashion through Genie you know dashboards and SQL and that's this that was a big one for us by the way right we didn't want something that's just just locked up in a dashboard or just in Genie but available also on SQL so that if you want to query it outside of data bricks you can also do that if you want to do it from a custom app you can also do that so that was you know one of our bigger focuses just to kind of wrap all of this stuff up right you want to be able to define your data model you want to be able to define your measures and dimensions you want to be able to centrally govern them right you want to be able to get all the stuff you're getting with Unity catalog today like think search think lineage think you know role role level masking role level filtering column masking auditing you know every kind of basically governance piece that you get you get with metric views you can certify them right so certification is something we're going to be introducing I don't know if it's get announced yet but it is something that we're going to be introducing at summit right which is whereby you can have a certain data steward role in unity catalog certifying different types of assets right so that asset is more trusted in search it appears in the in first results right when you're looking at lineage you see hey this is off of a certified asset and that also works with metrics, right?
So now when you come to Unity, you have a fully governed, fully certified, right, set of assets that you can directly expose to your end users without them having to do any modeling themselves. And finally, right, in some cases, you're going to want to materialize stuff for performance because so far everything we talked about with metrics is logical, meaning all of this stuff is calculated just in time. These are all just definitions of stuff.
But with the materialization piece, right, what we're doing is we're bringing in the ability to materialize slices of metrics. Let's say you have a, you know, metric view which has many different metrics, many different dimensions, but you want to say, hey, I always want my revenue by time, region, and business unit to be premputed. I never want any of my users to wait for that to be computed. And you can do that with built-in materializations, right? your end users still end up quing the metric view, but behind the scenes we see, hey, is there a materialization we can look at and give a faster response so that you don't calculate it on the fly?
And that's something we're building into the metrics layer and the semantic layer here. And finally, once you have all of this defined, once you have all of this kind of settled, you want to be able to do natural language, you want to be able to dashboards, you want to be able to do notebooks and query it from your SQL REST, OBBC, JDBC, Python, Go Node, you know, whatever your, you know, your poison is and get that kind of going and that's what kind of what we built with Kellogg metrics.
And just to note, right, metrics is not the only piece of your semantic layer. Sorry, it's just a piece of your semantic layer. It is not the semantic layer because we view semantics as more than just being able to define your data and model right it's all these other things that comes with unity catalog and what you'll see us also do is some of these semantic metadata I mentioned like such as display names formatting synonyms all of these other things will not just be metric view concepts we're actually going to expand that so that you can put for any queryable asset any table any view any materialized view or any other like other asset right like dashboard whatever whatever context it makes sense you're going to be able to attach these semantic metadata and consume them any place where you're consuming those things.
So I would kind of want to zoom out one sec and say metrics kind of enrich the Unity catalog story but that's not where we're going to kind of finish you know introducing semantics into Unity catalog. All right. So I am gonna switch over to do a quick demo because I'm sure you guys want to prefer a demo over slides and then after that I will try to save like around five 10 minutes so that we can do like a little Q&A and then take anything and then we can cover all the questions.

8:30 Metric view demonstration

All right, cool. Is the zoom good? Let me maybe zoom once more. Something like this. Good. Okay. So what you're seeing here is just for maybe just to just to maybe zoom out one sec. So this is a data bricks workspace right this is basically where you see you know all your data assets this is where you search for assets this is where you come for notebooks queries your dashboards right this is basically your starting point with data bricks what I'm looking at right now is the catalog browser where all of your unity catalog metadata lives and right now what we're looking at is a metric view called order metrics which by the way lives in you know just like your other tables and databases I have my personal database here I I have a schema called metric view testing and I just put it there just for your reference and a metric view as I said is you know three main things fundamentally right it's a data model right in this case a source or set of tables in this case I actually built a quick start schema here with a one fact table and one dimension table but you know this is as many dimension tables as you want obviously once you have that source or data model right then you come and define your measures right and measures are aggregation calculations these are things is like where you're kind of taking an existing value and doing something with it like just very basic examples like total revenue order counts.
Um you can take total revenue over order count. For example, here's I'm using one measure over another measure, right? I can do things like window measures. So if I wanted to do like trailing 7-day revenue, I can take my total 7-day revenue and put a window on it to get total 7-day revenue. Things like that. And then once I have my measures, the next thing is dimensions, right? And dimensions are things I mean you know this but just to kind of recap dimensions are things where you want to allow your measures to be sliced or filtered or grouped by all these dimensions.
That's what a dimension is from the perspective of a metric view. And in this case right we have as simple as a column reference saying order dates but we also do some pre-processing with some you know SQL case statements and other things. The whole point here is we're not introducing a new language. We're not introducing a new concept. What we're doing here is repurposing SQL and SQL expressions to be able to define these measure dimension and other metadata concepts right within your Unity catalog to kind of get you uh going with all of this.
And once you have defined this kind of package, right, this becomes something that you can expose and make available to others, right? You can give permissions just like you're giving permissions to other, you know, other tables or assets. you can, you know, shortly, it's not in this release, but it's going to come in like a month. You're going to be able to see things like lineage. You can already tag them. I have the pre feature tag here, for example.
Um, you will be able to see insights, right? So, who's using it, who's favoring it, like you know, what are the top joins, top assets, all of that stuff. So, it is fully integrated in the Unity catalog. And if I wanted to start asking questions, it's very easy. So, as you can see, there's a button called Ask Genie here. So if I click on it right what it does is it gives me like a quick adog genie space where this metric view is associated with that genie space and I can ask start asking questions for example let's say it's suggesting me some stuff here let's say I want to look at show you know average order value by shipping mode I click on it and what it's doing behind the scenes is it has access to all the metadata I had in my metric view right so what's this doing is it's analyzing my question per genie.
But then instead of generating a query on top of the base tables because it knows that it has a metric view with these definitions and it knows what is what, it actually generates a query directly on the metric view itself. And then the benefit of this is that behind this thing there might be like mini joins, windows, a bunch of abstractions, right, that you might want to not want to expose to Genie or to your SQL users.
But the benefit of automatic view is it kind of abstracts it a bit, right? So your end users or genie or anything that needs to generate SQL has an interface that's much simpler, that's much more businessoriented, that's much more like tell me your measures, tell me your dimensions, tell me your filters kind of API as opposed to you having to figure out all these complicated window functions, joins, self joins and things like that.
And obviously though you will want to ask stuff that may not be directly in the metric view and Genie can already do that, right? If you wanted to ask something like for example like what what do I have for example I don't have like a month over month growth rate for my revenue right? If I wanted to say what about month over month growth rate for revenue total revenue. What it's going to do is it's going to try to see if there's a measure that actually matches that directly.
It's going to realize there isn't one. And now what's it going to do? It's going to take you know our existing total revenue measure and then do a window on it itself so that you can get it. So the whole point that I'm trying to show you all is metrics gives genie superpowers in that it abstracts so many other kind of things in your data model that you can start building on top of it and get you know uh more accurate responses across your genie your dashboards and SQL.
Talking about dashboards, let me actually kind of switch over for one second because this was the genie side, right? But the beauty of these metric views is that they can be consumed from anywhere. So if you cons switch over to dashboards very quickly here, I'm just going to create a new dashboard with you guys here. Now, um, so the first things first is we go to the data tab. We add the data source. I'm just going to select the order metrics that we created.

14:11 Dashboard integration

And once we do that um lake view the dashboards know that it's working with measures and dimensions by the way and it gives me a quick preview. If I did not have access to change something in the metrics by the way but if I wanted to add a measure I can quickly do that here right I can add a new dimension or measure quickly add if I wanted to do that this level if I switch over to my canvas let's just start building stuff right metric views are already integrated into lake view just like other table assets and we know how to generate all of this behind the scenes so when you start you know let's say doing a chart I can just go to the axis selectors just in this case I'm just going to select let's say date and then for my y-axis let's select total revenue oh and now what it's doing is it's generating a query and refreshing this table and the beauty here is because lake knows how to generate metrics queries it is automatically going to know and how to do it you can use the assistant to help change stuff.
What about uh revenue by shipping mode? Right? The whole point here is this is fully integrated across the stack, right? Whether you're using Genie, whether you're using the dashboards, right? It is going to know how to work with it. It is going to know how to query it. Um so if you don't want to write any SQL, you don't have to write any SQL. But if you want to do write one of SQL, that also works. So, switching gears one more time and I'm kind of rushing just so we have time for the Q&A.
We can go over to any of these examples if you guys want me to take a look. Um, the SQL stuff is also fully integrated, right? So, let's take a look at this example I'm showing you here. The thing we've done is we've integrated metric views as direct queryable objects in the both Spark and Unity catalog. So now when you come and want to query a metric view, you can just put it in the from clause just like you're selecting from a table.

16:14 SQL query flexibility

You select your dimensions. In this case, I have two like month and status. And then I specify my measures. Obviously, if you want to put filters, you can put filters in here too. We support anything SQL supports. But I just want to keep kind of simple. And what this query is going to do is we're going to take this query, look into your metric definition, look into what the measures are, what the joins are, what the aggregations are, what the filters are, and going to compile this into a much larger query.
So in reality, what's going to execute behind this is a join. There's no window function. This could have been a window function with a bunch of aggregations plus there's a big huge case statement on the status. But from the user perspective, it's a very simple, you know, relatively kind of understandable function. And that's what kind of we were trying to do it. Right? If you want to keep this very high level, very simple, you can do that.
Right? Dimensions, measures, filters. Great. If you wanted to do more complicated stuff, for example, now I'm doing like something where I am extracting quarters. I don't want months. I want to go up. I'm rolling it up. I am doing top five revenue by month. So, that's another thing. If I wanted to, I could have gotten the this join the results of this with another metric view. So, it's very flexible in that, right? You can have multiple metric views.
You can have a metric view building on top of a metric view. And then you can query all of these things across the stack just like you're quing other tables and views without, you know, with code or without code. And one final bit that I forgot to show you all is in the catalog explorer, right? You might ask, hey, how do I get started with this? You can go to any table. Let's go to like some orders table. I have like a TPC table here.

18:14 Bootstrap and wrap-up

We have our team asked footage and they've asked if I can wear a wireless so if I go to this table for example if I click on the assistant and say I don't know if I can do that okay that's fine for example now I'm asking help me suggest a degree suggest relevant measures, right? It it it knows that I am talking about this data set, right? It's suggesting dimensions and measures and then now it's giving me the full DDL for me to be able to create this metric view and use it somewhere.
So, if I click on this open in metrics view editor thing, it actually drops me with all of the stuff we created with the definition of that metric view we just looked at. Right? So, that gave me a starting point one second. Now if I wanted to make edits to the assistant, I can also do that. Right? If I come back and say add a new measure that uh is a ratio of existing measures, total price and average price. Oh, I made so many spelling mistakes.
Did I understand that? H there you there you go. Oh no, there you go. Price, right? For example, it added one. So the whole point is you can use the assistant to help bootstrap and get started very quickly on this from existing sets, you know, from like your lake view dashboard. So if you have a lake view data set, if you open the assistance and say, hey, help me get started with a metric view, it will actually app suggest one thing that you can start.
One question that comes up is when do I need to use metric views? I'm going to say you don't have to use metric views or all your use cases, right? Metric views are great for when you have KPIs that you need to have accurate responses for, when you want to make something repeatable, when you want to have something accessible through multiple interfaces. If you're just getting started in Genie or if you're just getting started in Lake View doing add analysis, you don't need to create a metric view, right?
You come and create a metric view and you want to have an asset that you can govern, certify and make use with others. So that's I think like one thing to also like helpful, right? Metric view is not the tool for every project. It's a tool when you use when you want to disseminate and make something predictable and you know accurate. But yeah, that's all I had for you guys today. Any questions?

Learn more about the Databricks Data and AI platform.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.