<?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: Performance issue with AVERAGEX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Performance-issue-with-AVERAGEX/m-p/4387096#M174149</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Thank you for your help. I think applying additional filter later to the visual would still slow down the performance so I chose "bhanu_gautam"'s soltuion. I have a question. You mentioned about "&lt;SPAN&gt;pre-aggregate data in&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Power Query"&lt;/STRONG&gt;. How&amp;nbsp;do I go about doing this?&lt;/P&gt;&lt;H1&gt;&amp;nbsp;&lt;/H1&gt;&lt;H1&gt;&amp;nbsp;&lt;/H1&gt;</description>
    <pubDate>Wed, 29 Jan 2025 23:01:59 GMT</pubDate>
    <dc:creator>JustinDoh1</dc:creator>
    <dc:date>2025-01-29T23:01:59Z</dc:date>
    <item>
      <title>Performance issue with AVERAGEX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Performance-issue-with-AVERAGEX/m-p/4385295#M174068</link>
      <description>&lt;P&gt;I have a about 1.1 million rows of data with 7 columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this measure called "&lt;SPAN&gt;&lt;STRONG&gt;Average&lt;/STRONG&gt;"&lt;/SPAN&gt;&amp;nbsp;to filter my visual, PBI visual is having a big performance/memory issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is detail of that measure that is causing performance issue:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;STRONG&gt;Average&lt;/STRONG&gt; =&lt;/SPAN&gt; &lt;SPAN&gt;AVERAGEX&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DimDate&lt;/SPAN&gt;&lt;SPAN&gt;[DateFormat]&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &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; &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; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;[ClientD_M1]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I tried on the visual as 'Average is not 0', the visual is having a performance issue:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;Bottom is detail of a measure called &lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;[ClientD_M1]&lt;/SPAN&gt;:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ClientD_M1 =&lt;/SPAN&gt; &lt;SPAN&gt;count&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'TblCensus'&lt;/SPAN&gt;&lt;SPAN&gt;[ClientID]&lt;/SPAN&gt;&lt;SPAN&gt;) + &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Is there any better way to optimize the DAX of "Average" by chance?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Or is there any way to apply the filter (value that is greater than 0) in other possibly way?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 28 Jan 2025 23:58:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Performance-issue-with-AVERAGEX/m-p/4385295#M174068</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2025-01-28T23:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with AVERAGEX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Performance-issue-with-AVERAGEX/m-p/4385467#M174083</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="296339" data-lia-user-login="JustinDoh1" class="lia-mention lia-mention-user"&gt;JustinDoh1&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;The AVERAGEX function combined with VALUES may cause performance issues because of the excessive number of rows and context transitions it creates.&amp;nbsp;If you can simplify the context in which AVERAGEX operates, it might help. You can try using the following DAX:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Average = 
AVERAGEX(
    ALLSELECTED(DimDate[DateFormat]),
    [ClientD_M1]
)
&lt;/LI-CODE&gt;
&lt;P&gt;If possible, pre-aggregate data in &lt;STRONG&gt;Power Query&lt;/STRONG&gt; or in the data source to reduce the number of rows processed in DAX and reduce context switching.&lt;BR /&gt;&lt;BR /&gt;Another approach is to use SUMMARIZE to create a table with the precomputed values, and then use AVERAGEX on that summary table.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Average = 
VAR SummarizedTable = 
    SUMMARIZE(
        'TblCensus',
        'TblCensus'[DateFormat],
        "ClientCount", COUNT('TblCensus'[ClientID])
    )
RETURN
    AVERAGEX(
        SummarizedTable,
        [ClientCount]
    )
&lt;/LI-CODE&gt;
&lt;P&gt;Hope this will help you!&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Dino Tao&lt;BR /&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 05:29:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Performance-issue-with-AVERAGEX/m-p/4385467#M174083</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-29T05:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with AVERAGEX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Performance-issue-with-AVERAGEX/m-p/4385468#M174084</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="296339" data-lia-user-login="JustinDoh1" class="lia-mention lia-mention-user"&gt;JustinDoh1&lt;/a&gt;&amp;nbsp;Instead of using VALUES, you can use SUMMARIZE to create a summarized table that might perform better.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Average = &lt;BR /&gt;AVERAGEX(&lt;BR /&gt;FILTER(&lt;BR /&gt;SUMMARIZE(&lt;BR /&gt;'TblCensus',&lt;BR /&gt;DimDate[DateFormat],&lt;BR /&gt;"ClientD_M1", [ClientD_M1]&lt;BR /&gt;),&lt;BR /&gt;[ClientD_M1] &amp;gt; 0&lt;BR /&gt;),&lt;BR /&gt;[ClientD_M1]&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 05:31:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Performance-issue-with-AVERAGEX/m-p/4385468#M174084</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2025-01-29T05:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with AVERAGEX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Performance-issue-with-AVERAGEX/m-p/4387096#M174149</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;Thank you for your help. I think applying additional filter later to the visual would still slow down the performance so I chose "bhanu_gautam"'s soltuion. I have a question. You mentioned about "&lt;SPAN&gt;pre-aggregate data in&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Power Query"&lt;/STRONG&gt;. How&amp;nbsp;do I go about doing this?&lt;/P&gt;&lt;H1&gt;&amp;nbsp;&lt;/H1&gt;&lt;H1&gt;&amp;nbsp;&lt;/H1&gt;</description>
      <pubDate>Wed, 29 Jan 2025 23:01:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Performance-issue-with-AVERAGEX/m-p/4387096#M174149</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2025-01-29T23:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with AVERAGEX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Performance-issue-with-AVERAGEX/m-p/4387137#M174152</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="296339" data-lia-user-login="JustinDoh1" class="lia-mention lia-mention-user"&gt;JustinDoh1&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;For example, you can group your data in Power Query to reduce the amount of data you need to process and complete some calculations in advance. This is just one of the ways to aggregate data in Power Query, and you can explore other methods on your own.&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/power-query/group-by" target="_blank"&gt;How to GROUP BY or summarize rows - Power Query | Microsoft Learn&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Dino Tao&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 00:47:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Performance-issue-with-AVERAGEX/m-p/4387137#M174152</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-30T00:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with AVERAGEX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Performance-issue-with-AVERAGEX/m-p/4387169#M174153</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp; Regards to my case where I need to filter by "Average" is not 0, how do I group by? "Average" is a measure. Would Power Query work with a measure, not just column? Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 01:38:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Performance-issue-with-AVERAGEX/m-p/4387169#M174153</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2025-01-30T01:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue with AVERAGEX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Performance-issue-with-AVERAGEX/m-p/4387178#M174154</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;&amp;nbsp;I have a question. I am experimeting with performance. It appears that when I try the same query in &lt;STRONG&gt;Bookmark&lt;/STRONG&gt;, it is really slow or even it crashes. It says "There's not enough memory to complete this operation."&amp;nbsp;Why is that?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 02:10:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Performance-issue-with-AVERAGEX/m-p/4387178#M174154</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2025-01-30T02:10:49Z</dc:date>
    </item>
  </channel>
</rss>

