<?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 How to create a DAX measure that references two different tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-DAX-measure-that-references-two-different-tables/m-p/1755817#M36670</link>
    <description>&lt;P&gt;I have a transaction fact table with just Date, Sales, and Units by WIC (product ID). Then I have a second dimension product table that contains item cost for each WIC. I want to create a measure that will lookup the item cost from the DIM table for each WIC in the Fact table without having to Merge or create a calculated column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I merge the two tables and bring in item cost from the DIM table and create a sumx measure to calculate units * item cost, the totals are correct. However, I want to avoid merging the tables due to memory usage. Below is a screenshot of both results. Total Cost is using the merge table then the sumx measure, however, I can't get the same results without merging the tables. The results are almost double (column "Total Prod Cost $). Please help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Mar 2021 22:15:27 GMT</pubDate>
    <dc:creator>hibarrbm</dc:creator>
    <dc:date>2021-03-30T22:15:27Z</dc:date>
    <item>
      <title>How to create a DAX measure that references two different tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-DAX-measure-that-references-two-different-tables/m-p/1755817#M36670</link>
      <description>&lt;P&gt;I have a transaction fact table with just Date, Sales, and Units by WIC (product ID). Then I have a second dimension product table that contains item cost for each WIC. I want to create a measure that will lookup the item cost from the DIM table for each WIC in the Fact table without having to Merge or create a calculated column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I merge the two tables and bring in item cost from the DIM table and create a sumx measure to calculate units * item cost, the totals are correct. However, I want to avoid merging the tables due to memory usage. Below is a screenshot of both results. Total Cost is using the merge table then the sumx measure, however, I can't get the same results without merging the tables. The results are almost double (column "Total Prod Cost $). Please help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 22:15:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-DAX-measure-that-references-two-different-tables/m-p/1755817#M36670</guid>
      <dc:creator>hibarrbm</dc:creator>
      <dc:date>2021-03-30T22:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a DAX measure that references two different tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-DAX-measure-that-references-two-different-tables/m-p/1755818#M36671</link>
      <description>&lt;P&gt;This is the measure i tried using to avoid merging the tables&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Total Prod Cost $ = CALCULATE(SUMX(Fact_Fulfilled_Sales_MarketplaceODD, Fact_Fulfilled_Sales_MarketplaceODD[UNITS] * AVERAGE(DIM_Product[Average Cost])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 30 Mar 2021 22:17:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-DAX-measure-that-references-two-different-tables/m-p/1755818#M36671</guid>
      <dc:creator>hibarrbm</dc:creator>
      <dc:date>2021-03-30T22:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a DAX measure that references two different tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-DAX-measure-that-references-two-different-tables/m-p/1756675#M36686</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="252464" data-lia-user-login="hibarrbm" class="lia-mention lia-mention-user"&gt;hibarrbm&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have the model like below, please try similar to the below measure ( try to use RELATED function in the measure).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;Costs&lt;/STRONG&gt; = &lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;SUMX(FactSales, FactSales[Unit] * RELATED( DimProducts[UnitCost]))&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The link down below is the sample pbix file that I created for this question.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://www.dropbox.com/s/deubgncq1s8t1yw/sample%200331.pbix?dl=0" target="_self"&gt;https://www.dropbox.com/s/deubgncq1s8t1yw/sample%200331.pbix?dl=0&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;FONT face="”times" color="”#000000”"&gt;&lt;EM&gt;&lt;STRONG&gt;Hi, My name is Jihwan Kim. &lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”times" color="”#000000”"&gt;&lt;EM&gt;&lt;STRONG&gt;If this post helps, then please consider accept it as the solution to help other members find it faster.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 31 Mar 2021 07:40:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-DAX-measure-that-references-two-different-tables/m-p/1756675#M36686</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2021-03-31T07:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a DAX measure that references two different tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-DAX-measure-that-references-two-different-tables/m-p/1758188#M36749</link>
      <description>&lt;P&gt;It worked! Thanks again for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 18:20:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-DAX-measure-that-references-two-different-tables/m-p/1758188#M36749</guid>
      <dc:creator>hibarrbm</dc:creator>
      <dc:date>2021-03-31T18:20:50Z</dc:date>
    </item>
  </channel>
</rss>

