<?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: Running total on a large scale dataset in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-on-a-large-scale-dataset/m-p/3808677#M148914</link>
    <description>&lt;P&gt;how does that require a running total?&amp;nbsp; And how fast does it have to be?&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 20:11:38 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-04-03T20:11:38Z</dc:date>
    <item>
      <title>Running total on a large scale dataset</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-on-a-large-scale-dataset/m-p/3797529#M148416</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having a 80 million record dataset. When I was doing the POC report that has only account number, I used the following fomular to generate my balance:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Balance =&lt;/SPAN&gt; &lt;SPAN&gt;[Opening balance]&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;transaction&lt;/SPAN&gt;&lt;SPAN&gt;[Amount]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;transaction&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;[Index]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;transaction&lt;/SPAN&gt;&lt;SPAN&gt;[Index]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The above fomular works exactly as what I want. However, when I load not all my data, but just over 10 million data, this fomular gives me an error message saying that it's running out resources.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Then I thought about dividing my original transaction table into pieces first as for my report, anyway, one account number and only one account number must have been selected. I used the following fomular to divide my table:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FilteredTable =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATETABLE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'transaction'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'transaction'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'transaction'&lt;/SPAN&gt;&lt;SPAN&gt;[Account_number]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'transaction'&lt;/SPAN&gt;&lt;SPAN&gt;[Account_number]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;It gives me an empty table, if I replaced "SELECTEDVALUE('transaction'[Account_number])" by a fixed text string, new table will be created with data.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Anybody can help me on this issue?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 28 Mar 2024 19:03:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-on-a-large-scale-dataset/m-p/3797529#M148416</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-28T19:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Running total on a large scale dataset</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-on-a-large-scale-dataset/m-p/3797693#M148427</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try&lt;/P&gt;
&lt;P&gt;Balance =&lt;BR /&gt;VAR OpenBslsnce = [Opening balance]&lt;BR /&gt;VAR IndexAmount =&lt;BR /&gt;ADDCOLUMNS (&lt;BR /&gt;CALCULATETABLE ( VALUES ( transaction[Index] ), ALLSELECTED () ),&lt;BR /&gt;"@Amt",&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM ( transaction[Amount] ),&lt;BR /&gt;ALLEXCEPT ( transaction, transaction[Index] )&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;VAR Amount =&lt;BR /&gt;SUMX (&lt;BR /&gt;WINDOW ( 0, abs, 0, rel, IndexAmount, ORDERBY ( transaction[Index], ASC ) ),&lt;BR /&gt;[@Amt]&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;OpenBalance + Amount&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 21:28:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-on-a-large-scale-dataset/m-p/3797693#M148427</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2024-03-28T21:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Running total on a large scale dataset</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-on-a-large-scale-dataset/m-p/3803510#M148714</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An error message indicating resource exhaustion can be due to the complexity and size of the dataset processed by the formula. Power BI has certain limitations when working with large datasets, especially when it comes to memory usage.&lt;BR /&gt;Use variables to break down formulas into smaller, manageable pieces. This improves readability and performance.&amp;nbsp;Ensure that their use is absolutely necessary and cannot be simplified.&lt;/P&gt;
&lt;P&gt;The problem with creating a filter table that returns an empty can be due to the way the function is used. When there is a value in the specified column in the current context, a value is returned; Otherwise, it will return a blank. This may mean that your slicer or filter context doesn't have a single selected account at the time of calculation&lt;/P&gt;
&lt;P&gt;Make sure that the slicer or filter settings allow for a single selection, or that the filter context that returns a non-null value is applied correctly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Temporarily replace with a hard-coded account number (as you've done) to confirm that the rest of the formula is working as expected. This helps to isolate the problem to the dynamic selection part of the formula.&lt;BR /&gt;If possible, review and optimize the performance of your data model. This could include reducing the number of columns, ensuring proper indexing, or breaking down data into smaller, more manageable tables.&lt;/P&gt;
&lt;P&gt;For further optimization techniques and to understand limitations, see the following resources:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/guidance/power-bi-optimization" target="_blank"&gt;Optimization guide for Power BI - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 6.0pt 0cm 0cm 0cm;"&gt;&lt;SPAN&gt;&lt;A title="https://community.powerbi.com/t5/community-blog/how-to-get-your-question-answered-quickly/ba-p/38490" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C02%7Cv-yohua%40microsoft.com%7Ce1106bfabecb4734a5cc08dc2305bc51%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638423754744679080%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=24%2BceC5sFd3n3%2FhFDYILWFcNjCwVClBD%2BPBsSLVfJGk%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Yongkang Hua&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 03:46:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-on-a-large-scale-dataset/m-p/3803510#M148714</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-02T03:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Running total on a large scale dataset</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-on-a-large-scale-dataset/m-p/3808489#M148903</link>
      <description>&lt;P&gt;Thans tamerj1 for your solution, unfortunately when I applied it on a 20 milliaon record table, it's again running out of resources and my actual table has over 80 million records.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 18:04:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-on-a-large-scale-dataset/m-p/3808489#M148903</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-03T18:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Running total on a large scale dataset</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-on-a-large-scale-dataset/m-p/3808670#M148912</link>
      <description>&lt;P&gt;a running total over 80 million records seems a bit excessive.&amp;nbsp; What is the business question you are trying to answer?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 20:07:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-on-a-large-scale-dataset/m-p/3808670#M148912</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-04-03T20:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Running total on a large scale dataset</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-on-a-large-scale-dataset/m-p/3808673#M148913</link>
      <description>&lt;P&gt;We have a table that has all client's transaction since they become our client. Sometimes, people would ask us to generate a statement of account for a particular client.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 20:09:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-on-a-large-scale-dataset/m-p/3808673#M148913</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-03T20:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Running total on a large scale dataset</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-on-a-large-scale-dataset/m-p/3808677#M148914</link>
      <description>&lt;P&gt;how does that require a running total?&amp;nbsp; And how fast does it have to be?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 20:11:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-on-a-large-scale-dataset/m-p/3808677#M148914</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-04-03T20:11:38Z</dc:date>
    </item>
  </channel>
</rss>

