<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Metric views joins in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/metric-views-joins/m-p/154048#M54059</link>
    <description>&lt;P&gt;I am currently working on a migration project from power BI to ai bi dashboard in databricks . Now i am using the metric views to create all the measures and DAX queries which i have in my power BI report in YAML in the metric views but the main problem is as in power bi&amp;nbsp; we ca select the columns from multiple tables but the same this i cant do in databricks as we can only select a single datasource while creating a chart .&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Let me give you an example suppose i have sales table and a&amp;nbsp; product table and there are two columns from the both the table in power bi but to do the same thing metric views i cant do it , as either i can select my sales table or my product table .&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Akshatkumar69_0-1775806455687.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/25878i6A08C6376E72467D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Akshatkumar69_0-1775806455687.png" alt="Akshatkumar69_0-1775806455687.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;for example this you can refer to One is from sales by state one is from sales by maker .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Apr 2026 07:35:06 GMT</pubDate>
    <dc:creator>Akshatkumar69</dc:creator>
    <dc:date>2026-04-10T07:35:06Z</dc:date>
    <item>
      <title>Metric views joins</title>
      <link>https://community.databricks.com/t5/data-engineering/metric-views-joins/m-p/154048#M54059</link>
      <description>&lt;P&gt;I am currently working on a migration project from power BI to ai bi dashboard in databricks . Now i am using the metric views to create all the measures and DAX queries which i have in my power BI report in YAML in the metric views but the main problem is as in power bi&amp;nbsp; we ca select the columns from multiple tables but the same this i cant do in databricks as we can only select a single datasource while creating a chart .&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Let me give you an example suppose i have sales table and a&amp;nbsp; product table and there are two columns from the both the table in power bi but to do the same thing metric views i cant do it , as either i can select my sales table or my product table .&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Akshatkumar69_0-1775806455687.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/25878i6A08C6376E72467D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Akshatkumar69_0-1775806455687.png" alt="Akshatkumar69_0-1775806455687.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;for example this you can refer to One is from sales by state one is from sales by maker .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2026 07:35:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/metric-views-joins/m-p/154048#M54059</guid>
      <dc:creator>Akshatkumar69</dc:creator>
      <dc:date>2026-04-10T07:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Metric views joins</title>
      <link>https://community.databricks.com/t5/data-engineering/metric-views-joins/m-p/154059#M54060</link>
      <description>&lt;P&gt;&lt;FONT size="3"&gt;You can approach it in multiple ways&lt;/FONT&gt;&lt;/P&gt;&lt;H3&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;&lt;STRONG&gt;1. Unified Metric View&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;P&gt;&lt;FONT size="3"&gt;Build a single unified view by joining &lt;STRONG&gt;Sales&lt;/STRONG&gt; and &lt;STRONG&gt;Product&lt;/STRONG&gt; tables.&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="3"&gt;It allows to expose &lt;STRONG&gt;State&lt;/STRONG&gt; and &lt;STRONG&gt;Maker&lt;/STRONG&gt; as dimensions within one metric view.&lt;/FONT&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;FONT size="3"&gt;&lt;SPAN class=""&gt;CREATE&lt;/SPAN&gt; &lt;SPAN class=""&gt;VIEW&lt;/SPAN&gt;&lt;SPAN&gt; sales_product_view &lt;/SPAN&gt;&lt;SPAN class=""&gt;AS&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;SPAN class=""&gt;SELECT&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt; s.state,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt; s.sales_amount,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt; p.maker&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;SPAN class=""&gt;FROM&lt;/SPAN&gt;&lt;SPAN&gt; sales s&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;SPAN class=""&gt;JOIN&lt;/SPAN&gt;&lt;SPAN&gt; product p &lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;SPAN class=""&gt;ON&lt;/SPAN&gt;&lt;SPAN&gt; s.product_id &lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; p.product_id;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;Its s&lt;SPAN&gt;imple and quick to implement with c&lt;/SPAN&gt;&lt;SPAN&gt;entralized logic&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;H3&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;&lt;STRONG&gt;2. Modular Metric Views with Joins&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;P&gt;&lt;FONT size="3"&gt;Create &lt;STRONG&gt;separate modular metric views&lt;/STRONG&gt; based on purpose&lt;/FONT&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Sales by State&lt;/STRONG&gt; - Metric View with a&amp;nbsp;join between sales and state dimension&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;Sales by Maker -&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT size="3"&gt;Metric view with&lt;/FONT&gt; a join between sales and product dimension.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;FONT size="3"&gt;It a&lt;/FONT&gt;&lt;FONT size="3"&gt;ligns well with domain driven design and easy to manage&lt;/FONT&gt;&lt;/P&gt;&lt;H3&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;&lt;STRONG&gt;3. Star Schema Approach&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;P&gt;&lt;FONT size="3"&gt;Adopt a &lt;STRONG&gt;star schema&lt;/STRONG&gt;&amp;nbsp;(Fact &amp;amp; Dimension) design as it s&lt;/FONT&gt;implifies metric view creation with easier governance and extensibility if it supports the case.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2026 10:23:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/metric-views-joins/m-p/154059#M54060</guid>
      <dc:creator>balajij8</dc:creator>
      <dc:date>2026-04-10T10:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Metric views joins</title>
      <link>https://community.databricks.com/t5/data-engineering/metric-views-joins/m-p/154064#M54061</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/226572"&gt;@Akshatkumar69&lt;/a&gt;, welcome to the community.&lt;/P&gt;
&lt;P&gt;You're not alone on this one, it is common with folks coming from Power BI.&lt;/P&gt;
&lt;P&gt;The key thing to understand is that AI/BI charts do expect a single data source, but that source can be a metric view that already joins your tables together. You don't need to pick just one table.&lt;/P&gt;
&lt;P&gt;For your Sales + Product example, this is a classic fact-to-dimension pattern, and metric views handle it natively through the joins block in the YAML:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-yaml"&gt;version: 0.1
source: my_catalog.my_schema.sales

joins:
  - name: product
    source: my_catalog.my_schema.product
    on: product.product_id = source.product_id

dimensions:
  - name: State
    expr: state
  - name: Maker
    expr: product.maker

measures:
  - name: Total Sales
    expr: SUM(sales_amount)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then in AI/BI, you point your chart at this single metric view. "Sales by State" and "Sales by Maker" both work from the same source because the join is already defined in the semantic layer.&lt;/P&gt;
&lt;P&gt;One thing to be aware of. Metric view joins are designed for many-to-one relationships (fact to dimension). If you're joining two fact tables or dealing with a many-to-many relationship, the metric view join won't give you correct results. In those cases, create a pre-joined SQL view in Unity Catalog and use that as your metric view source instead.&lt;/P&gt;
&lt;P&gt;The mental model shift from Power BI is this: instead of the tool resolving relationships at query time, you define them upfront in your metric view YAML. Once that's in place, the single-source constraint stops being a limitation.&lt;/P&gt;
&lt;P&gt;Cheers, Lou&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2026 11:21:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/metric-views-joins/m-p/154064#M54061</guid>
      <dc:creator>Louis_Frolio</dc:creator>
      <dc:date>2026-04-10T11:21:26Z</dc:date>
    </item>
  </channel>
</rss>

