<?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 calculate a measure with values from two fact tables on the lowest level of granularity? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-a-measure-with-values-from-two-fact-tables-on/m-p/1314890#M23061</link>
    <description>&lt;P&gt;Tabular model has 2 fact tables:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Sales (fact table)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CustomerId&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;TimePeriodId&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ProductId&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;lt;Several another dimensions Ids&amp;gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;and&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Discount (fact table)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CustomerId&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;TimePeriodId&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ProductId&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Discount&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Sales table has [ComplexMeasure] measure that uses another measures chain for calculations, in the lowest level it has SUM(Amount).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to add a new measure with formula = ComplexMeasure x Discount, but I can't use here something like average discount, instead of that I shoud multiply every Amount from the Sales table by corresponding Discount from the Discount table. I can't change ComplexMeasure or measures that used in this measure calculation. And I don't want to re-create all these measures, but with SUM(Sales[Amount] x Discount[Discount]) on the lowest level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any idea how I could implement that using a DAX expression?&lt;/P&gt;</description>
    <pubDate>Fri, 21 Aug 2020 13:41:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-08-21T13:41:57Z</dc:date>
    <item>
      <title>How to calculate a measure with values from two fact tables on the lowest level of granularity?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-a-measure-with-values-from-two-fact-tables-on/m-p/1314890#M23061</link>
      <description>&lt;P&gt;Tabular model has 2 fact tables:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Sales (fact table)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CustomerId&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;TimePeriodId&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ProductId&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;lt;Several another dimensions Ids&amp;gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Amount&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;and&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Discount (fact table)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CustomerId&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;TimePeriodId&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ProductId&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Discount&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Sales table has [ComplexMeasure] measure that uses another measures chain for calculations, in the lowest level it has SUM(Amount).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to add a new measure with formula = ComplexMeasure x Discount, but I can't use here something like average discount, instead of that I shoud multiply every Amount from the Sales table by corresponding Discount from the Discount table. I can't change ComplexMeasure or measures that used in this measure calculation. And I don't want to re-create all these measures, but with SUM(Sales[Amount] x Discount[Discount]) on the lowest level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any idea how I could implement that using a DAX expression?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 13:41:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-a-measure-with-values-from-two-fact-tables-on/m-p/1314890#M23061</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-21T13:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate a measure with values from two fact tables on the lowest level of granularity?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-a-measure-with-values-from-two-fact-tables-on/m-p/1314945#M23065</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can add a calculated column to table Sales to get the corresponding discount for each customer. Then create the following measure:&lt;/P&gt;&lt;P&gt;NewMeasure = CALCULATE(Sales, SUMX([ComplexMeasure] * [CalculatedColumnDiscount])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should do the trick.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If my answer solves your problem, please give Kudos and mark as solution &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 13:58:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-a-measure-with-values-from-two-fact-tables-on/m-p/1314945#M23065</guid>
      <dc:creator>saraMissBI</dc:creator>
      <dc:date>2020-08-21T13:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate a measure with values from two fact tables on the lowest level of granularity?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-a-measure-with-values-from-two-fact-tables-on/m-p/1315126#M23071</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Try like&lt;/P&gt;
&lt;P&gt;sumx(summarize(Sales, customer[CustomerId],date[TimePeriodId],Product[ProductId], "_1", sum(Sales[Amount]) , "_2", max(Discount[Discount])),[_1]*[_2])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Changes the measure and aggregation as per need&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 14:58:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-a-measure-with-values-from-two-fact-tables-on/m-p/1315126#M23071</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-08-21T14:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate a measure with values from two fact tables on the lowest level of granularity?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-a-measure-with-values-from-two-fact-tables-on/m-p/1316184#M23119</link>
      <description>Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="179989" data-lia-user-login="saraMissBI" class="lia-mention lia-mention-user"&gt;saraMissBI&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;It's a very, very, very bad idea to have a measure that would iterate a big fact table and execute CALCULATE against each and every row. The measure will be AGONIZINGLY SLOW and will lead to memory overflow. One should never do it. Apart from that, the measure is syntactically incorrect.</description>
      <pubDate>Sat, 22 Aug 2020 09:56:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-a-measure-with-values-from-two-fact-tables-on/m-p/1316184#M23119</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-22T09:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate a measure with values from two fact tables on the lowest level of granularity?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-a-measure-with-values-from-two-fact-tables-on/m-p/1319693#M23192</link>
      <description>&lt;P&gt;Yes, it works. Thank you!&lt;/P&gt;&lt;P&gt;It seems that you query groups all data from Sales and then if the coresponding Discount exists adds value to the result.&lt;/P&gt;&lt;P&gt;I would like to increase the performance of the query by filtering Sales items before grouping operation. Is it possible to have grouped sales only that have link to discount table? Probably I should use RELATEDTABLE in this query, but I can't figure out how to use it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2020 14:27:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-a-measure-with-values-from-two-fact-tables-on/m-p/1319693#M23192</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-24T14:27:03Z</dc:date>
    </item>
  </channel>
</rss>

