<?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: How to Improve Performance of Running Total DAX Calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Improve-Performance-of-Running-Total-DAX-Calculation/m-p/3086599#M107946</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please try something like below.&lt;/P&gt;
&lt;P&gt;I don't think it improved extremely, but it did improve a little.&lt;/P&gt;
&lt;P&gt;Please check if it suits your requirement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Running total % =
VAR _carbontotal =
    CALCULATE ( [Carbon Sum], ALLSELECTED ( Emission[Building Name] ) )
VAR _newtable =
    ADDCOLUMNS (
        ALLSELECTED ( Emission[Building Name] ),
        "@carbonsum", [Carbon Sum]
    )
VAR _cumulatetable =
    ADDCOLUMNS (
        _newtable,
        "@cumulatesum",
            SUMX (
                FILTER ( _newtable, [@carbonsum] &amp;gt;= EARLIER ( [@carbonsum] ) ),
                [@carbonsum]
            ),
        "@total", _carbontotal
    )
RETURN
    MAXX (
        FILTER (
            ADDCOLUMNS ( _cumulatetable, "@result", DIVIDE ( [@cumulatesum], [@total] ) ),
            Emission[Building Name] = MAX ( Emission[Building Name] )
        ),
        [@result]
    )&lt;/LI-CODE&gt;</description>
    <pubDate>Sun, 19 Feb 2023 16:05:00 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2023-02-19T16:05:00Z</dc:date>
    <item>
      <title>How to Improve Performance of Running Total DAX Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Improve-Performance-of-Running-Total-DAX-Calculation/m-p/3086542#M107936</link>
      <description>&lt;P&gt;Hi PBI Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am building a dashboard where Running Total (based on percentage of emission) need to be shown. This visual would be effected by various filters such as region, country and others.&lt;BR /&gt;Following is the measure that works, however the computing time is in excess of 1 minute and unable to compute if the dashboard is published (Visual has exceeded the available resources).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is the sample pbix File. (Data has 59k rows) &lt;A title="RunningTotal pbix" href="http://sendanywhe.re/2H1NOTQ8" target="_blank" rel="noopener"&gt;RunningTotal Power BI File&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Carbon RT % = 
VAR CarbonRT = CALCULATE([Carbon Sum],FILTER(ALLSELECTED(Emission[Building Name]),SUM(Emission[Carbon])&amp;lt;=[Carbon Sum]))
VAR CarbonTotal = CALCULATE(SUM(Emission[Carbon]),ALLSELECTED(Emission[Building Name]))
VAR CarbonPercentage = DIVIDE(CarbonRT,CarbonTotal)
Return CarbonPercentage&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way I can optimise the measure to run faster or other alternative approach?&lt;/P&gt;&lt;P&gt;Of course limiting the table visual does help in performance, however the requirement is to display the overall table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your input.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Feb 2023 14:21:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Improve-Performance-of-Running-Total-DAX-Calculation/m-p/3086542#M107936</guid>
      <dc:creator>MyKr</dc:creator>
      <dc:date>2023-02-19T14:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to Improve Performance of Running Total DAX Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Improve-Performance-of-Running-Total-DAX-Calculation/m-p/3086599#M107946</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please try something like below.&lt;/P&gt;
&lt;P&gt;I don't think it improved extremely, but it did improve a little.&lt;/P&gt;
&lt;P&gt;Please check if it suits your requirement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Running total % =
VAR _carbontotal =
    CALCULATE ( [Carbon Sum], ALLSELECTED ( Emission[Building Name] ) )
VAR _newtable =
    ADDCOLUMNS (
        ALLSELECTED ( Emission[Building Name] ),
        "@carbonsum", [Carbon Sum]
    )
VAR _cumulatetable =
    ADDCOLUMNS (
        _newtable,
        "@cumulatesum",
            SUMX (
                FILTER ( _newtable, [@carbonsum] &amp;gt;= EARLIER ( [@carbonsum] ) ),
                [@carbonsum]
            ),
        "@total", _carbontotal
    )
RETURN
    MAXX (
        FILTER (
            ADDCOLUMNS ( _cumulatetable, "@result", DIVIDE ( [@cumulatesum], [@total] ) ),
            Emission[Building Name] = MAX ( Emission[Building Name] )
        ),
        [@result]
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 19 Feb 2023 16:05:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Improve-Performance-of-Running-Total-DAX-Calculation/m-p/3086599#M107946</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-02-19T16:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to Improve Performance of Running Total DAX Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Improve-Performance-of-Running-Total-DAX-Calculation/m-p/3086997#M107966</link>
      <description>&lt;P&gt;Nice improvement,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;. I wrote almost the same measure before I saw your response.&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="517277" data-lia-user-login="MyKr" class="lia-mention lia-mention-user"&gt;MyKr&lt;/a&gt;&amp;nbsp;note that while improving the DAX is great, the real issue on performance is that you have a visual that has &amp;gt;11K rows. If you are creating a visual for people to export data, that's one thing. Otherwise, you may want to consider a report design that limits the # of rows in the table at any given time.&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>Mon, 20 Feb 2023 02:53:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Improve-Performance-of-Running-Total-DAX-Calculation/m-p/3086997#M107966</guid>
      <dc:creator>ppm1</dc:creator>
      <dc:date>2023-02-20T02:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to Improve Performance of Running Total DAX Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Improve-Performance-of-Running-Total-DAX-Calculation/m-p/3088050#M108052</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt; , brilliant, your solutions works well and significantly reduced the calculation time! thank you.&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="443516" data-lia-user-login="ppm1" class="lia-mention lia-mention-user"&gt;ppm1&lt;/a&gt;&amp;nbsp; thanks for the support. Yes, it is alot of data! but unfortunately that is the requirement to facilitate discussion. Will surely keep the limit in mind.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 13:39:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Improve-Performance-of-Running-Total-DAX-Calculation/m-p/3088050#M108052</guid>
      <dc:creator>MyKr</dc:creator>
      <dc:date>2023-02-20T13:39:06Z</dc:date>
    </item>
  </channel>
</rss>

