<?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: Need measures that will work with a larger dataset (out of memory errors) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-measures-that-will-work-with-a-larger-dataset-out-of-memory/m-p/1902332#M41032</link>
    <description>&lt;P&gt;The link I sent was for general knowledge on optimizing iterators, and wasn't necessarily specific to your scenario.&amp;nbsp; Sorry for the confusion.&amp;nbsp; The #RT measure probably performs ok; the performance issue is because you are calling that measure within other nested iterators on a high granularity column (ID).&amp;nbsp; You need to reduce the granularity and try to avoid nested iteration.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jun 2021 00:22:06 GMT</pubDate>
    <dc:creator>mahoneypat</dc:creator>
    <dc:date>2021-06-16T00:22:06Z</dc:date>
    <item>
      <title>Need measures that will work with a larger dataset (out of memory errors)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-measures-that-will-work-with-a-larger-dataset-out-of-memory/m-p/1896348#M40863</link>
      <description>&lt;P&gt;I have 4 working measures prefixed with # &lt;A href="https://we.tl/t-601fFuIvJb" target="_self"&gt;in this example Power BI report.&lt;/A&gt; The measures work fine with the example data but when I use real data (approx. 90 million imported rows with filters applied to reduce the dataset for scenario testing) I get out of memory errors on some visuals, unless I apply more filters to reduce the dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is there a way to re-write these measures so that they will work better with a large dataset?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure 1 is an interim measure to calculate Measure 2:&lt;/P&gt;&lt;P&gt;&lt;FONT size="2" color="#0000FF"&gt;#RT =&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; CALCULATE(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SUMX(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ADDCOLUMNS(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUMMARIZE(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DummyDataID, DummyDataID[ID]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"ExAmt",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[Exceeded Amount]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[ExAmt]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FILTER(ALLSELECTED(DummyDataID), DummyDataID[ID] &amp;lt;= MAX(DummyDataDemand[ID]))&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#0000FF"&gt;)&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Measure 2&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;#RT_filtered =&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;VAR currentID = SELECTEDVALUE ( DummyDataID[ID] )&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;VAR firstID = MINX ( ALLSELECTED ( DummyDataID ), DummyDataID[ID] )&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;VAR minValue = MINX ( FILTER ( DummyDataID, DummyDataID[ID] = firstID ), [Exceeded Amount] )&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;VAR minOfSum =&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; MIN (&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; 0,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; MINX ( FILTER ( ALLSELECTED ( DummyDataID ), DummyDataID[ID] &amp;lt;= currentID ), [#RT] )&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;&amp;nbsp; &amp;nbsp; )&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;RETURN&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;IF (&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;currentID = firstID &amp;amp;&amp;amp; minValue &amp;lt; 0,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;[#RT] - minValue,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;[#RT] - minOfSum&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;)&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Measure 3 is the sum of the values from Measure 2&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;#RT with sum =&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;IF(HASONEVALUE(DummyDataID[ID]), [#RT_filtered], SUMX(VALUES(DummyDataID[ID]), [#RT_filtered]))&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Measure 4 is the highest value&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;#RT max =&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;MAXX(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;ADDCOLUMNS(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;SUMMARIZE(DummyDataID, DummyDataID[ID]),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;"@RT", [#RT with sum]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;[#RT with sum]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#0000FF"&gt;)&lt;/FONT&gt;&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>Fri, 11 Jun 2021 15:46:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-measures-that-will-work-with-a-larger-dataset-out-of-memory/m-p/1896348#M40863</guid>
      <dc:creator>DataNoobie</dc:creator>
      <dc:date>2021-06-11T15:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Need measures that will work with a larger dataset (out of memory errors)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-measures-that-will-work-with-a-larger-dataset-out-of-memory/m-p/1896776#M40879</link>
      <description>&lt;P&gt;It would be hard to optimize this without a decent # of rows of data and then use DAX studio to optimize.&amp;nbsp; In any case, your measures have iterators than call functions that also have nested iterators, and that is the source of the problem.&amp;nbsp; If you have a high number of values for ID (and you likely do with 90 M rows), that will get very slow very fast.&amp;nbsp; Please see this article to see how to approach optimizing them.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/optimizing-nested-iterators-in-dax/" target="_blank"&gt;Optimizing nested iterators in DAX - SQLBI&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jun 2021 02:27:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-measures-that-will-work-with-a-larger-dataset-out-of-memory/m-p/1896776#M40879</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2021-06-12T02:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need measures that will work with a larger dataset (out of memory errors)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-measures-that-will-work-with-a-larger-dataset-out-of-memory/m-p/1900769#M40989</link>
      <description>&lt;DIV class="line number13 index12 alt2"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="226208" data-lia-user-login="mahoneypat" class="lia-mention lia-mention-user"&gt;mahoneypat&lt;/a&gt;&amp;nbsp;I've looked at the most optimal solution from the link you provided.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sales Amount Optimal&amp;nbsp;:=&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;SUMX&amp;nbsp;(&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;VALUES&amp;nbsp;(&amp;nbsp;Customer[Customer Discount]&amp;nbsp;),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SUMX&amp;nbsp;(&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;VALUES&amp;nbsp;(&amp;nbsp;'Product'[Product Discount]&amp;nbsp;),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;VAR&amp;nbsp;DiscountedProduct&amp;nbsp;=&amp;nbsp;1&amp;nbsp;-&amp;nbsp;'Product'[Product Discount]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;VAR&amp;nbsp;DiscountedCustomer&amp;nbsp;=&amp;nbsp;1&amp;nbsp;-&amp;nbsp;Customer[Customer Discount]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RETURN&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Gross Amount]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;DiscountedProduct&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;DiscountedCustomer&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The measure I need to get into this pattern (I'm assuming) is below. How do I change it to get into the pattern (the pattern above isn't using a running total)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#RT =&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CALCULATE&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;SUMX(&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ADDCOLUMNS(&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;SUMMARIZE(&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;DummyDataID, DummyDataID[ID]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"ExAmt",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[Exceeded Amount]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;[ExAmt]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;FILTER(ALLSELECTED(DummyDataID), DummyDataID[ID] &amp;lt;= MAX(DummyDataDemand[ID]))&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 15 Jun 2021 08:54:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-measures-that-will-work-with-a-larger-dataset-out-of-memory/m-p/1900769#M40989</guid>
      <dc:creator>DataNoobie</dc:creator>
      <dc:date>2021-06-15T08:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need measures that will work with a larger dataset (out of memory errors)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-measures-that-will-work-with-a-larger-dataset-out-of-memory/m-p/1902332#M41032</link>
      <description>&lt;P&gt;The link I sent was for general knowledge on optimizing iterators, and wasn't necessarily specific to your scenario.&amp;nbsp; Sorry for the confusion.&amp;nbsp; The #RT measure probably performs ok; the performance issue is because you are calling that measure within other nested iterators on a high granularity column (ID).&amp;nbsp; You need to reduce the granularity and try to avoid nested iteration.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 00:22:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-measures-that-will-work-with-a-larger-dataset-out-of-memory/m-p/1902332#M41032</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2021-06-16T00:22:06Z</dc:date>
    </item>
  </channel>
</rss>

