<?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: Optimize DAX query in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Optimize-DAX-query/m-p/3473412#M132650</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;, thanks for you reply. It does proces a lot of rows. Millions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a Pro license so I don't think that the workspace is assigned to Premium capacity? Is it still possible to optimize the query itself with some easy tricks?&lt;/P&gt;</description>
    <pubDate>Thu, 12 Oct 2023 11:51:51 GMT</pubDate>
    <dc:creator>Vinnie</dc:creator>
    <dc:date>2023-10-12T11:51:51Z</dc:date>
    <item>
      <title>Optimize DAX query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Optimize-DAX-query/m-p/3468204#M132388</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to optimize the following DAX query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALCULATE(
    SUMX(
        SUMMARIZECOLUMNS(
            'Loan balance history'[source loan part id],
            "AverageOutstandingAmount", 
            AVERAGE('Loan balance history'[outstanding amount])
        ),
        [AverageOutstandingAmount]
    ),
    USERELATIONSHIP(Calender[Date], 'Loan balance history'[Date])
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use this DAX statement in a Power BI measure to calculate the amount of 'outstanding amount'. I want to show it on different drill-down levels (year, quarter, month, week, day). So that is why I am taking a SUM of the AVERAGE outstanding amount per loan ID.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the end I use this measure in a visual and I can zoom out to year level. But I do get an error that I surpas the query limit of 1331 MB.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We use a Power BI Pro license and I don't think that we can set a higher query limit. So what is left is optimizing the query. I don't know where to start, can someone maybe help me?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 08:07:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Optimize-DAX-query/m-p/3468204#M132388</guid>
      <dc:creator>Vinnie</dc:creator>
      <dc:date>2023-10-10T08:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize DAX query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Optimize-DAX-query/m-p/3472361#M132600</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="508480" data-lia-user-login="Vinnie" class="lia-mention lia-mention-user"&gt;Vinnie&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Have many records did this query process? Did these content assigned in the premium capacity? If that's the case, you can try to increase the limit about query memory if it helps for your situation:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/enterprise/service-admin-premium-workloads" target="_blank"&gt;How to configure workloads in Power BI Premium - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 02:13:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Optimize-DAX-query/m-p/3472361#M132600</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-12T02:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize DAX query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Optimize-DAX-query/m-p/3473412#M132650</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;, thanks for you reply. It does proces a lot of rows. Millions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a Pro license so I don't think that the workspace is assigned to Premium capacity? Is it still possible to optimize the query itself with some easy tricks?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 11:51:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Optimize-DAX-query/m-p/3473412#M132650</guid>
      <dc:creator>Vinnie</dc:creator>
      <dc:date>2023-10-12T11:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize DAX query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Optimize-DAX-query/m-p/3473828#M132677</link>
      <description>&lt;P&gt;does it perform better if you rewrite your measure like below?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALCULATE(
    SUMX(
        VALUES('Loan balance history'[source loan part id]),
        CALCULATE(AVERAGE('Loan balance history'[outstanding amount]))
        )
     ),
    USERELATIONSHIP(Calender[Date], 'Loan balance history'[Date])
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 12 Oct 2023 15:31:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Optimize-DAX-query/m-p/3473828#M132677</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2023-10-12T15:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize DAX query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Optimize-DAX-query/m-p/3478899#M132960</link>
      <description>&lt;P&gt;I have adjusted the DAX code. The result (output) is the same. How can I see how much MB my query is using in Power BI service?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It sometimes works, sometimes it gives me the error. I would like to check how much MB the query is using (if it exceeds the 1331MB limit).&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 13:02:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Optimize-DAX-query/m-p/3478899#M132960</guid>
      <dc:creator>Vinnie</dc:creator>
      <dc:date>2023-10-16T13:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize DAX query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Optimize-DAX-query/m-p/3490899#M133662</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="508480" data-lia-user-login="Vinnie" class="lia-mention lia-mention-user"&gt;Vinnie&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;If these contents are host in the shared capacities, they were not able to configure or increase and will use the default settings.&lt;/P&gt;
&lt;P&gt;For the expression itself, it looks like a measure calculation with multiple aggregations. How many records your data table stored that need to be calculated? Any nested or invoke in other expressions?&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 09:16:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Optimize-DAX-query/m-p/3490899#M133662</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-23T09:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Optimize DAX query</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Optimize-DAX-query/m-p/3498177#M134045</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;, thanks again for your reply. This query processes about 6 million rows. I actually fixed the error I was getting on the visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The visual holds two measures (one for the amount (euro) of the outstanding amount and one for the amount of loans that have this outstanding amount). Both were calculated in the same way (so a group by loan number, and then sumx or countx).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I simplified the count by doing a distinctcount() instead of a group by (summarize()) and then countx().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works for now but I am still wondering how I am able to measure the amount of MB a query is using. Is that possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The content is not assinged in a premium capacity.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 07:35:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Optimize-DAX-query/m-p/3498177#M134045</guid>
      <dc:creator>Vinnie</dc:creator>
      <dc:date>2023-10-26T07:35:34Z</dc:date>
    </item>
  </channel>
</rss>

