<?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 can I make SUMX faster? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-make-SUMX-faster/m-p/2694329#M81221</link>
    <description>&lt;P&gt;Hi Gao,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for the late reply. Unfortunately it didnt work. Using Summarize in a measure over a large dataset simply slows down the overall performance. I changed the setup completely by creating different tables, creating relationships and then apply ''userelationship''. This way I could delete the need for summarize and have speedy model.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your support!&lt;/P&gt;</description>
    <pubDate>Thu, 11 Aug 2022 07:32:36 GMT</pubDate>
    <dc:creator>Bundi009</dc:creator>
    <dc:date>2022-08-11T07:32:36Z</dc:date>
    <item>
      <title>How can I make SUMX faster?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-make-SUMX-faster/m-p/2668058#M79449</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have applied this code many times for different variables. Everthing works, its just really slow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there an easier way to compute this measure?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VolumeCY Comparable = 
SUMX(SUMMARIZE(FILTER(FactData,FactData[Adjustments]=""&amp;amp;&amp;amp;FactData[One Time Article flag]="no"),
                FactData[Customer Code],
                FactData[Product code (SKU)],
                FactData[One Time Article flag],
                FactData[Sales channel],
                FactData[Price Calculation Origin],
                FactData[isServiceItem],
                FactData[Sales Agent],
                FactData[Manual overwrite?],
                FactData[Base Unit of Measure],
                FactData[Currency]),
            if(and([VolumesCY]&amp;lt;&amp;gt;0,[VolumesPY]&amp;lt;&amp;gt;0),[VolumesCY],0))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 20:05:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-make-SUMX-faster/m-p/2668058#M79449</guid>
      <dc:creator>Bundi009</dc:creator>
      <dc:date>2022-07-28T20:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make SUMX faster?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-make-SUMX-faster/m-p/2668301#M79476</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="408647" data-lia-user-login="Bundi009" class="lia-mention lia-mention-user"&gt;Bundi009&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are a couple of suggested tweaks:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Apply filters to columns rather than the FactData table using CALCULATE.&lt;/LI&gt;
&lt;LI&gt;Use variables for the CY/PY measure values.&lt;/LI&gt;
&lt;LI&gt;Return blank rather than zero if either [VolumesCY] or [VolumesPY] is zero.&lt;/LI&gt;
&lt;/OL&gt;
&lt;LI-CODE lang="markup"&gt;VolumeCY Comparable =
CALCULATE (
    SUMX (
        SUMMARIZE (
            FactData,
            FactData[Customer Code],
            FactData[Product code (SKU)],
            FactData[One Time Article flag],
            FactData[Sales channel],
            FactData[Price Calculation Origin],
            FactData[isServiceItem],
            FactData[Sales Agent],
            FactData[Manual overwrite?],
            FactData[Base Unit of Measure],
            FactData[Currency]
        ),
        VAR CY = [VolumesCY]
        VAR PY = [VolumesPY]
        RETURN
            IF ( AND ( CY &amp;lt;&amp;gt; 0, PY &amp;lt;&amp;gt; 0 ), CY )
    ),
    KEEPFILTERS ( FactData[Adjustments] = "" ),
    KEEPFILTERS ( FactData[One Time Article flag] = "no" )
)&lt;/LI-CODE&gt;
&lt;P&gt;Does this improve performance at all?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would there be anything to optimize in the [VolumesCY] and [VolumesPY] measures?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Owen&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 23:45:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-make-SUMX-faster/m-p/2668301#M79476</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2022-07-28T23:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make SUMX faster?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-make-SUMX-faster/m-p/2670202#M79597</link>
      <description>&lt;P&gt;Thank you very much Owen for your help. Unfortunately, it does not really make a change (&amp;lt;2% improvement).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VolumeCY is pretty straight forward too:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VolumesCY = calculate(sum(FactData[Qty sold]),(filter(FactData,FactData[Year]="2022")))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think its just the shortcoming of having summarize as a measure in the model that makes it really slow when you have many rows (around 8M in my case) and with many columns to be taken into account. I tried this first in Power Query but it did not solve the issue either due to some model specifications.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 20:24:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-make-SUMX-faster/m-p/2670202#M79597</guid>
      <dc:creator>Bundi009</dc:creator>
      <dc:date>2022-07-29T20:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make SUMX faster?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-make-SUMX-faster/m-p/2671111#M79665</link>
      <description>&lt;P&gt;You're welcome, and sorry to hear it didn't improve much.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps some improvements can be made to the overall data model, such as including dimension tables containing the various columns that SUMMARIZE is grouping by.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, a Date table would be useful if you have measures that filter based on year.&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2022 13:51:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-make-SUMX-faster/m-p/2671111#M79665</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2022-07-31T13:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make SUMX faster?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-make-SUMX-faster/m-p/2674686#M79869</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="408647" data-lia-user-login="Bundi009" class="lia-mention lia-mention-user"&gt;Bundi009&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VolumeCY Comparable =
SUMX (
    SUMMARIZE (
        FILTER (
            FactData,
            FactData[Adjustments] = ""
                &amp;amp;&amp;amp; FactData[One Time Article flag] = "no"
        ),
        FactData[Customer Code],
        FactData[Product code (SKU)],
        FactData[One Time Article flag],
        FactData[Sales channel],
        FactData[Price Calculation Origin],
        FactData[isServiceItem],
        FactData[Sales Agent],
        FactData[Manual overwrite?],
        FactData[Base Unit of Measure],
        FactData[Currency]
    ),
    SWITCH (
        TRUE (),
        [VolumesCY] = 0, 0,
        [VolumesPY] = 0, 0,
        [VolumesCY] &amp;lt;&amp;gt; 0
            &amp;amp;&amp;amp; [VolumesPY] &amp;lt;&amp;gt; 0, [VolumesCY],
        0
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;Or&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VolumeCY Comparable =
SUMX (
    SUMMARIZE (
        FILTER (
            FactData,
            FactData[Adjustments] = ""
                &amp;amp;&amp;amp; FactData[One Time Article flag] = "no"
        ),
        FactData[Customer Code],
        FactData[Product code (SKU)],
        FactData[One Time Article flag],
        FactData[Sales channel],
        FactData[Price Calculation Origin],
        FactData[isServiceItem],
        FactData[Sales Agent],
        FactData[Manual overwrite?],
        FactData[Base Unit of Measure],
        FactData[Currency]
    ),
    IF ( [VolumesCY] ^ 2 + [VolumesPY] ^ 2 &amp;lt;&amp;gt; 0, [VolumesCY], 0 )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Best Regards,&lt;BR /&gt;Gao&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;Community Support Team&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;If there is any post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT size="3" color="#FF0000" data-darkreader-inline-color=""&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT size="3"&gt;&lt;FONT color="#FF0000" data-darkreader-inline-color=""&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT size="3"&gt;Thanks a lot!&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2" color="#FF0000" data-darkreader-inline-color=""&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;How to get your questions answered quickly&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;--&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;How to provide sample data&lt;/SPAN&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 07:16:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-make-SUMX-faster/m-p/2674686#M79869</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-02T07:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make SUMX faster?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-make-SUMX-faster/m-p/2686400#M80705</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="408647" data-lia-user-login="Bundi009" class="lia-mention lia-mention-user"&gt;Bundi009&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any updates?&lt;/P&gt;
&lt;P&gt;My idea is that if it is not possible to reduce the number of iterations, then try to reduce the number of times the measures in the second parameter needs to be calculated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure if this will work. I'm curious to see how it turns out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Best Regards,&lt;BR /&gt;Gao&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;Community Support Team&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 06:43:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-make-SUMX-faster/m-p/2686400#M80705</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-08T06:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: How can I make SUMX faster?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-make-SUMX-faster/m-p/2694329#M81221</link>
      <description>&lt;P&gt;Hi Gao,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for the late reply. Unfortunately it didnt work. Using Summarize in a measure over a large dataset simply slows down the overall performance. I changed the setup completely by creating different tables, creating relationships and then apply ''userelationship''. This way I could delete the need for summarize and have speedy model.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your support!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 07:32:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-make-SUMX-faster/m-p/2694329#M81221</guid>
      <dc:creator>Bundi009</dc:creator>
      <dc:date>2022-08-11T07:32:36Z</dc:date>
    </item>
  </channel>
</rss>

