<?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 Re: Reference total of one measure in another in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-total-of-one-measure-in-another/m-p/1097012#M16035</link>
    <description>&lt;P style="color: red;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your correct measures are:&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;TotalInvoiceAmt_CY =
	CALCULATE (
	     [InvoiceAmt_CY],
	     ALLSELECTED()
	)

TotalInvoiceAmt_PY =
	CALCULATE (
	     [InvoiceAmt_PY],
	     ALLSELECTED()
	)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your measure returns BLANKs because... well, it's to do with the filter context and context transition. In a word, it's complex and it would take a lot of time and space to explain why you see what you see.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Advice is - you should never, ever do things like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CALCULATE (
     SUMX('fact SalesInvoiceView',[InvoiceAmt_PY]),
     ALLSELECTED()
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Summing over the entire (expanded) fact table with context transition because of a measure is a &lt;STRONG&gt;SURE WAY TO CALCULATE INCORECT NUMBERS&lt;/STRONG&gt;. Please stay away from this practice. Please do not ever iterate over a fact table. This will not only be agonizingly slow. It's extremely dangerous for the correctness of the calculation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
    <pubDate>Wed, 20 May 2020 00:27:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-05-20T00:27:19Z</dc:date>
    <item>
      <title>Reference total of one measure in another</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-total-of-one-measure-in-another/m-p/1097003#M16032</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I'm trying to get the total of one measure as the row value of another. This is to recreate Excel formulas from our finance dept.&lt;BR /&gt;&lt;BR /&gt;In the example below, I need to 11,199,255 for all rows in TotalInvoiceAmt_PY. It works with my CY measure but not PY measures, probably because of the date filter I'm using. Can I get Power BI to refer to measure (not column) values?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;TIA&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;InvoiceAmt_CY = sum('fact SalesInvoiceView'[SalesAmountTCY])&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;InvoiceAmt_PY = CALCULATE([InvoiceAmt_CY], SAMEPERIODLASTYEAR('dim DatePosted'[ActualDate]))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;TotalInvoiceAmt_CY =&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;CALCULATE (&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUMX('fact SalesInvoiceView',[InvoiceAmt_CY]),&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ALLSELECTED()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;TotalInvoiceAmt_PY =&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;CALCULATE (&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUMX('fact SalesInvoiceView',[InvoiceAmt_PY]),&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ALLSELECTED()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 23:16:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-total-of-one-measure-in-another/m-p/1097003#M16032</guid>
      <dc:creator>brewery_dba</dc:creator>
      <dc:date>2020-05-19T23:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Reference total of one measure in another</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-total-of-one-measure-in-another/m-p/1097012#M16035</link>
      <description>&lt;P style="color: red;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your correct measures are:&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;TotalInvoiceAmt_CY =
	CALCULATE (
	     [InvoiceAmt_CY],
	     ALLSELECTED()
	)

TotalInvoiceAmt_PY =
	CALCULATE (
	     [InvoiceAmt_PY],
	     ALLSELECTED()
	)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your measure returns BLANKs because... well, it's to do with the filter context and context transition. In a word, it's complex and it would take a lot of time and space to explain why you see what you see.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Advice is - you should never, ever do things like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CALCULATE (
     SUMX('fact SalesInvoiceView',[InvoiceAmt_PY]),
     ALLSELECTED()
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Summing over the entire (expanded) fact table with context transition because of a measure is a &lt;STRONG&gt;SURE WAY TO CALCULATE INCORECT NUMBERS&lt;/STRONG&gt;. Please stay away from this practice. Please do not ever iterate over a fact table. This will not only be agonizingly slow. It's extremely dangerous for the correctness of the calculation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 00:27:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-total-of-one-measure-in-another/m-p/1097012#M16035</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-20T00:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Reference total of one measure in another</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-total-of-one-measure-in-another/m-p/1097027#M16039</link>
      <description>&lt;P&gt;Thanks for your feedback... could you recommend the correct approach to this problem? I have tried with ADDCOLUMNS ( VALUES&amp;nbsp; but still get the row context.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 23:59:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-total-of-one-measure-in-another/m-p/1097027#M16039</guid>
      <dc:creator>brewery_dba</dc:creator>
      <dc:date>2020-05-19T23:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Reference total of one measure in another</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-total-of-one-measure-in-another/m-p/1097035#M16041</link>
      <description>Have I not given you the correct measures at the top of my post?&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Wed, 20 May 2020 00:22:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-total-of-one-measure-in-another/m-p/1097035#M16041</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-20T00:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Reference total of one measure in another</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-total-of-one-measure-in-another/m-p/1097052#M16045</link>
      <description>&lt;P&gt;D, you certainly did. Much thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 01:04:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-total-of-one-measure-in-another/m-p/1097052#M16045</guid>
      <dc:creator>brewery_dba</dc:creator>
      <dc:date>2020-05-20T01:04:10Z</dc:date>
    </item>
  </channel>
</rss>

