<?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: Dax Query optimization in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-optimization/m-p/2285096#M56014</link>
    <description>&lt;P&gt;Is there any relationship between measure a, b and c. Just wondering if you could look at it from a maths point of view as to what needs to be true for all 3 to be greater than zero. That might be faster to test than actually evaluating the full values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you create a calculated table which materialises the table inside the sumx how many rows do you get? I agree with the others. Initial thought is it looks "ok". How slow is the query?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only other thought is depending on what you need to slice by are you able to preagregate anything in a calculated table to move some evaluation away to model processing instead of live at query time.&lt;/P&gt;</description>
    <pubDate>Sat, 15 Jan 2022 23:18:02 GMT</pubDate>
    <dc:creator>bcdobbs</dc:creator>
    <dc:date>2022-01-15T23:18:02Z</dc:date>
    <item>
      <title>Dax Query optimization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-optimization/m-p/2281488#M55824</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below query is for Total Sum of the positive values in tablur report, working as expected but liitle slow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to rewrite it in optimize way?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Correct Total Sum = SUMX(&lt;BR /&gt;FILTER(&lt;BR /&gt;ADDCOLUMNS(&lt;BR /&gt;SUMMARIZE(Fact,dimA[Aname],dimB[BName]),&lt;BR /&gt;"@MeasureA",[MeasureA],&lt;BR /&gt;"@MeasureB",[MeasureB)],&lt;BR /&gt;"@MeasureC",[MeasureC]&lt;/P&gt;&lt;P&gt;),&lt;BR /&gt;[@MeasureA]&amp;gt;0 &amp;amp;&amp;amp; [@MeasureB]&amp;gt;0 &amp;amp;&amp;amp; [@MeasureC]&amp;gt;0&lt;BR /&gt;)&lt;BR /&gt;,[@MeasureA]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 11:37:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-optimization/m-p/2281488#M55824</guid>
      <dc:creator>joepath</dc:creator>
      <dc:date>2022-01-13T11:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Query optimization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-optimization/m-p/2281568#M55831</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="102761" data-lia-user-login="joepath" class="lia-mention lia-mention-user"&gt;joepath&lt;/a&gt; , this seems fine, need to check calculation for three measures &lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 12:11:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-optimization/m-p/2281568#M55831</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-01-13T12:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Query optimization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-optimization/m-p/2284743#M55991</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp; Measure have basic avg calculations, Is there any way to replace filter function with calculatedtable? I see filter always create prob on a big table.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jan 2022 08:44:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-optimization/m-p/2284743#M55991</guid>
      <dc:creator>joepath</dc:creator>
      <dc:date>2022-01-15T08:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Query optimization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-optimization/m-p/2285094#M56013</link>
      <description>&lt;P&gt;I agree that measure looks pretty good, and would have written it the same way. How big is your Fact table and how many rows should that SUMMARIZE table have?&amp;nbsp; One thing you could try would be to filter it sequentially with FILTER(FILTER(FILTER. Not sure it will help much but easy to try.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Correct&amp;nbsp;Total&amp;nbsp;Sum&amp;nbsp;=&lt;BR /&gt;&lt;SPAN class="Keyword" style="color: #035aca;"&gt;SUMX&lt;/SPAN&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="indent4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="Keyword" style="color: #035aca;"&gt;FILTER&lt;/SPAN&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="Keyword" style="color: #035aca;"&gt;FILTER&lt;/SPAN&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="indent4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="Keyword" style="color: #035aca;"&gt;FILTER&lt;/SPAN&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="Keyword" style="color: #035aca;"&gt;ADDCOLUMNS&lt;/SPAN&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="indent4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="Keyword" style="color: #035aca;"&gt;SUMMARIZE&lt;/SPAN&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;&amp;nbsp;(&lt;/SPAN&gt;&amp;nbsp;Fact,&amp;nbsp;dimA[Aname],&amp;nbsp;dimB[BName]&amp;nbsp;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;)&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="indent4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="StringLiteral" style="color: #d93124;"&gt;"@MeasureA"&lt;/SPAN&gt;,&amp;nbsp;[MeasureA]&lt;BR /&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;)&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;[@MeasureA]&amp;nbsp;&amp;gt;&amp;nbsp;&lt;SPAN class="Number" style="color: #ee7f18;"&gt;0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="indent4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;)&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="indent4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;[MeasureB]&amp;nbsp;&amp;gt;&amp;nbsp;&lt;SPAN class="Number" style="color: #ee7f18;"&gt;0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;)&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;[MeasureC]&amp;nbsp;&amp;gt;&amp;nbsp;&lt;SPAN class="Number" style="color: #ee7f18;"&gt;0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="indent4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;)&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN class="indent4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;[@MeasureA]&lt;BR /&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jan 2022 22:19:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-optimization/m-p/2285094#M56013</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2022-01-15T22:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Query optimization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-optimization/m-p/2285096#M56014</link>
      <description>&lt;P&gt;Is there any relationship between measure a, b and c. Just wondering if you could look at it from a maths point of view as to what needs to be true for all 3 to be greater than zero. That might be faster to test than actually evaluating the full values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you create a calculated table which materialises the table inside the sumx how many rows do you get? I agree with the others. Initial thought is it looks "ok". How slow is the query?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only other thought is depending on what you need to slice by are you able to preagregate anything in a calculated table to move some evaluation away to model processing instead of live at query time.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jan 2022 23:18:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-optimization/m-p/2285096#M56014</guid>
      <dc:creator>bcdobbs</dc:creator>
      <dc:date>2022-01-15T23:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Query optimization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-optimization/m-p/2285195#M56018</link>
      <description>&lt;P&gt;Thanks all for looking into this, seems not much changes is required,&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jan 2022 10:37:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-optimization/m-p/2285195#M56018</guid>
      <dc:creator>joepath</dc:creator>
      <dc:date>2022-01-16T10:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Query optimization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-optimization/m-p/2403248#M62985</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="102761" data-lia-user-login="joepath" class="lia-mention lia-mention-user"&gt;joepath&lt;/a&gt;&amp;nbsp;- I agree with the others that you query is structured well.&amp;nbsp; A small suggestion is to possibly remove "&lt;SPAN&gt;dimA[Aname],&amp;nbsp;dimB[BName]" from the SUMMARIZE function.&amp;nbsp; Instead you could summarize by the FK_A and FK_B on the main fact table.&amp;nbsp; There is a small performance gain in the SUMMARIZE step because the query "may not" need JOINS between the Fact table and DimA and DimB tables.&amp;nbsp; However, this would not work through if "dimA[Aname]" and "dimB[BName]" are sets/groups of many FK_A and FK_B, or when the Filter Context applying to the Fact table is referencing these table anyway.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 12:11:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-optimization/m-p/2403248#M62985</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-18T12:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Query optimization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-optimization/m-p/2403251#M62988</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="102761" data-lia-user-login="joepath" class="lia-mention lia-mention-user"&gt;joepath&lt;/a&gt;&amp;nbsp;Most likely, the problem are inside the 3 measures you are using.&lt;BR /&gt;&lt;BR /&gt;Please give us the exact code of the three measures.&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 12:13:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Query-optimization/m-p/2403251#M62988</guid>
      <dc:creator>m3tr01d</dc:creator>
      <dc:date>2022-03-18T12:13:54Z</dc:date>
    </item>
  </channel>
</rss>

