<?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: RANKX timing out due to memory in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4376452#M173760</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the "TotalSales", i'm getting a column doesn't exist error&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jan 2025 20:51:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-01-22T20:51:44Z</dc:date>
    <item>
      <title>RANKX timing out due to memory</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4376390#M173754</link>
      <description>&lt;P&gt;I have a large table of records of agents and sales, wich each row representing one sale.&amp;nbsp; &amp;nbsp;I want the table visual to show a ranking of the total sales amount (sum of all rows) for each agent in a time frame the user selects a slicer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This the formula I have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Revenue Rank =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RANKX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Agent List'&lt;/SPAN&gt;&lt;SPAN&gt;[AgentID]&lt;/SPAN&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sales'&lt;/SPAN&gt;&lt;SPAN&gt;[AMOUNT]&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The Agent List table is a seperate table linked to the Sales table, basicallly just a list of every unique name and ID...&amp;nbsp; but I'm getting the same issue with that as I do if I just use the name in the sales table, which is that adding the formula to the table takes forever and eventually times out due to memory.&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Is there a better way to do this?&amp;nbsp; I get its taking long becuase its reading each row, but I can't get it to work&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Jan 2025 19:47:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4376390#M173754</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-22T19:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: RANKX timing out due to memory</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4376440#M173758</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please try this approach:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Revenue Rank =
RANKX(
    ADDCOLUMNS(
        VALUES('Agent List'[AgentID]),
        "TotalSales", CALCULATE(SUM('Sales'[AMOUNT]))
    ),
    [TotalSales],
    ,
    DESC,
    Skip
)
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Jan 2025 20:42:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4376440#M173758</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2025-01-22T20:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: RANKX timing out due to memory</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4376452#M173760</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the "TotalSales", i'm getting a column doesn't exist error&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 20:51:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4376452#M173760</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-22T20:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: RANKX timing out due to memory</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4376458#M173761</link>
      <description>&lt;P&gt;Thanks for your response&amp;nbsp;Anonymous&lt;/LI-USER&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please try the following:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Revenue Rank = 
VAR TotalSales = 
    SUMMARIZE(
        'Sales',
        'Sales'[AgentID],
        "TotalAmount", SUM('Sales'[AMOUNT])
    )
RETURN
    RANKX(
        TotalSales,
        [TotalAmount],
        ,
        DESC,
        DENSE
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 20:55:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4376458#M173761</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2025-01-22T20:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: RANKX timing out due to memory</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4377069#M173785</link>
      <description>&lt;P&gt;Thanks for the reply from Sahir_Maharaj&amp;nbsp;, please allow me to add some more information:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Hi&amp;nbsp; paguy215&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Does your Agent List table have a lot of duplicate [AgentID]?&lt;/P&gt;
&lt;P&gt;You can try creating a new table that contains only distinct [AgentID], then link the new table to the customer table and replace the Agent List table in the formula with the new table.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;new table =
DISTINCT ( 'Agent List'[AgentID] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Revenue Rank =
RANKX (
    ALLSELECTED ( 'new table'[AgentID] ),
    CALCULATE ( SUM ( 'Sales'[AMOUNT] ) )
)&lt;/LI-CODE&gt;
&lt;P&gt;If you need the rankx function to perform a dynamic display of TopN, you can use the TOPN() function to omit the steps:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/topn-function-dax" target="_blank"&gt;TOPN function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The slow loading of Power BI Desktop is related to other factors apart from functions and you can check the following:&lt;/P&gt;
&lt;P&gt;You can use DAX Studio to optimize the inspection of DAX statements from a performance perspective and use the Performance analyzer to check the performance of each of your report elements when users interact with them, and which aspects of performance consume the most (or least) resources&lt;/P&gt;
&lt;P&gt;&lt;A href="https://daxstudio.org/" target="_blank"&gt;DAX Studio | DAX Studio&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-performance-analyzer" target="_blank"&gt;Use Performance Analyzer to examine report element performance in Power BI Desktop - Power BI | Micr...&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Use a star schema design to simplify relationships and improve query performance:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Desktop/DAX-Optimization-Tips-for-Large-Models/m-p/4257939" target="_blank"&gt;DAX Optimization Tips for Large Models - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You can optimize the data model and increase the default values of the corresponding options to optimize query performance and minimize the number of visual objects on the report, each of which increases load time.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/guidance/power-bi-optimization" target="_blank"&gt;Optimization guide for Power BI - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-evaluation-configuration" target="_blank"&gt;Evaluation configuration settings for Desktop - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;There are also some suggestions for optimizing the model here:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Remove unused tables or columns, where possible.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Avoid distinct counts on fields with high cardinality – that is, millions of distinct values.&amp;nbsp;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Take steps to avoid fields with unnecessary precision and high cardinality. For example, you could split highly unique datetime values into separate columns – for example, month, year, date, and so on. Or, where possible, use rounding on high-precision fields to lower cardinality – (for example, 13.29889 -&amp;gt; 13.3).&lt;/LI&gt;
&lt;LI&gt;When connecting to data sources via Direct Query, consider indexing columns that are commonly filtered or sliced again. Indexing greatly improves report responsiveness.&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 06:38:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4377069#M173785</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-23T06:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: RANKX timing out due to memory</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4377120#M173788</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-pm-slice="0 0 []"&gt;To optimize your Revenue Rank calculation, you can first aggregate the sales by agent using the SUMMARIZE function and then rank the agents based on total sales. This reduces the row context and improves performance. Here's the optimized DAX formula:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Revenue Rank = 
VAR AgentSales = 
    SUMMARIZE(
        'Sales', 
        'Agent List'[AgentID], 
        "TotalSales", SUM('Sales'[AMOUNT])
    )
RETURN
    RANKX(
        AgentSales, 
        [TotalSales], 
        , 
        DESC, 
        Dense
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This approach calculates total sales per agent before ranking, reducing the workload and improving performance. It avoids row-by-row calculations, making it much more efficient.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 07:04:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4377120#M173788</guid>
      <dc:creator>Poojara_D12</dc:creator>
      <dc:date>2025-01-23T07:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: RANKX timing out due to memory</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4377774#M173807</link>
      <description>&lt;P&gt;Thanks, yeah its in a seperate table with distinct IDs.&amp;nbsp; I'll try and look at some of the other things you mentioned&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 13:00:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4377774#M173807</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-23T13:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: RANKX timing out due to memory</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4377775#M173808</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thanks, but I am still getting the same error ... 'either column doesn't exist or there is no row for this column'&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 13:01:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4377775#M173808</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-23T13:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: RANKX timing out due to memory</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4377788#M173809</link>
      <description>&lt;P&gt;Thanks but same error, it seems to not want to recognize the created column name&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 13:07:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4377788#M173809</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-23T13:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: RANKX timing out due to memory</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4378058#M173820</link>
      <description>&lt;LI-SPOILER&gt;&amp;nbsp;&lt;/LI-SPOILER&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so i ended up creating a new query to aggregate things there, and I can get the RANKX on the visual fairly easily...however now everything is ranked as 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is what i have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Revenue Rank =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RANKX&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Agent List'&lt;/SPAN&gt;&lt;SPAN&gt;[AgentID]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Query1&lt;/SPAN&gt;&lt;SPAN&gt;[SalesSum]&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SalesSum is calculated column on the new query, taking the sum of 1 column (tracked sales) and a 2nd column (non-tracked sales)... I tried removing the calculate part but it doesn't change anything&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 23 Jan 2025 15:28:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4378058#M173820</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-23T15:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: RANKX timing out due to memory</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4379451#M173850</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try the following dax, if you use ALLSELECTED('Agent List'[AgentID]), it is traversing the rank for each row of AgentID, and if you use ALLSELECTED('Agent List'), it is traversing the rank for the table Agent List:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Revenue Rank =
RANKX( ALLSELECTED('Agent List'), calculate(sum('Query1'[SalesSum])))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Rank Refer these links&lt;BR /&gt;&lt;A href="https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures" target="_blank"&gt;https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns" target="_blank"&gt;https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale" target="_blank"&gt;https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 09:25:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4379451#M173850</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-24T09:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: RANKX timing out due to memory</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4379805#M173863</link>
      <description>&lt;P&gt;Thanks, still doesn't work though.&amp;nbsp; I get some values other than 1 but still dozens or rows with different SalesSum amounts all ranked as 1&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 13:21:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4379805#M173863</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-24T13:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: RANKX timing out due to memory</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4379876#M173866</link>
      <description>&lt;P&gt;Actually i think i see the issue.&amp;nbsp; I also have a region and store column in the visual...when I remove those and just have the agentID and name, it works.&amp;nbsp; &amp;nbsp;So how can I get this to work with those two columns added?&amp;nbsp; &amp;nbsp;I've tried it with the store info in the same table and a unique table&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 13:58:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-timing-out-due-to-memory/m-p/4379876#M173866</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-24T13:58:26Z</dc:date>
    </item>
  </channel>
</rss>

