<?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: Need Help: SUMX with filter exceeds the ROW limit in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4758127#M182199</link>
    <description>&lt;P&gt;If you can add a new column, you can define the &lt;A href="https://dax.guide/sign/" target="_self"&gt;SIGN&lt;/A&gt;( FactTable[AmountBase] ) as a new column and write&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;CALCULATE (
    SUM ( FactTable[amount_base] ),
    FactTable[Sign] = -1,
    DATESBETWEEN (
        DimTable[business_date],
        [opening_date_range],
        [closing_date_range]
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Jul 2025 21:50:25 GMT</pubDate>
    <dc:creator>AlexisOlson</dc:creator>
    <dc:date>2025-07-09T21:50:25Z</dc:date>
    <item>
      <title>Need Help: SUMX with filter exceeds the ROW limit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4756829#M182123</link>
      <description>&lt;P&gt;Hi Community,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my set up. I have a fact table connects to a date dimensional table. The fact table itself is quite large.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The source of the fact table is another semantic model.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are the measure I use:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(FactTable&lt;/SPAN&gt;&lt;SPAN&gt;,FactTable&lt;/SPAN&gt;&lt;SPAN&gt;[amount_base]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;), FactTable&lt;/SPAN&gt;&lt;SPAN&gt;[amount_base]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;DATESBETWEEN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DimTable&lt;/SPAN&gt;&lt;SPAN&gt;[business_date]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[opening_date_range]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[closing_date_range]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;CALCULATE(SUMX(FILTER(FactTable,FactTable[amount_base]&amp;nbsp;&amp;gt; 0), FactTable[amount_base]), DATESBETWEEN(DimTable[business_date], [opening_date_range], [closing_date_range]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This measure returns an error message of the resultset of a query to external data source has exceeded the maxium allowed size of '1000000'. I believe it is due to the filter to check the FactTable[amount_base] &amp;gt; 0 and&amp;nbsp;FactTable[amount_base] &amp;lt; 0.&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;If I just calculate the sum&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(FactTable&lt;/SPAN&gt;&lt;SPAN&gt;[amount_base]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;DATESBETWEEN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DimTable&lt;/SPAN&gt;&lt;SPAN&gt;[business_date]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[opening_date_range],&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;[closing_date_range]&lt;/SPAN&gt;&lt;SPAN&gt;)), this is very fast and no error returns.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If I use the sum formula and apply the filter [amount_base] &amp;gt;0 on the visual level, it also returns the correct value and runs pretty faster. Unfortunately, I need to put all three measures (without filter, &amp;gt;0 and &amp;lt;0) on the same visual, so that I cannot just use visual level filter.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I have also tried to rewrite the measure to&amp;nbsp;&lt;BR /&gt;CALCULATE(SUM(FactTable[amount_base]),FactTable[amount_base] &amp;lt; 0,DATESBETWEEN(DimTable[business_date], [opening_date_range], [closing_date_range])) but still no luck.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any other tricks or tips I can utilize here? Appreciate your help!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2025 16:02:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4756829#M182123</guid>
      <dc:creator>dmkblesser</dc:creator>
      <dc:date>2025-07-08T16:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help: SUMX with filter exceeds the ROW limit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4756846#M182124</link>
      <description>&lt;P&gt;Try this instead:&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;CALCULATE (
    SUM ( FactTable[amount_base] ),
    KEEPFILTERS ( FactTable[amount_base] &amp;lt; 0 ),
    DATESBETWEEN (
        DimTable[business_date],
        [opening_date_range],
        [closing_date_range]
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2025 16:29:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4756846#M182124</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2025-07-08T16:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help: SUMX with filter exceeds the ROW limit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4756872#M182133</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;, thanks for your help! unfortunately, I'm still receiving the same error.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2025 16:59:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4756872#M182133</guid>
      <dc:creator>dmkblesser</dc:creator>
      <dc:date>2025-07-08T16:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help: SUMX with filter exceeds the ROW limit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4756919#M182139</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;, with your suggestion and I found this video: &lt;A href="https://www.youtube.com/watch?v=GFENAFw1co4" target="_blank"&gt;https://www.youtube.com/watch?v=GFENAFw1co4&lt;/A&gt; which talks about converting the visual filter into a measure. I think this is the same concept you suggested. I followed the same steps and received the same error. The interesting part is&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DEFINE 
	VAR __DS0FilterTable = 
		FILTER(
			KEEPFILTERS(VALUES('FactTable'[amount_base])),
			'FactTable'[amount_base] &amp;lt; 0
		)
	VAR _result = CALCULATE([sum_no_filter], __DS0FilterTable)

EVALUATE
	SUMMARIZECOLUMNS(
		__DS0FilterTable,
		"sum_no_filter", IGNORE('FactTable'[sum_no_filter])
	)&lt;/LI-CODE&gt;&lt;P&gt;the above part works, it does return me value. [sum_no_filter] here basically is the measure the sum measure in my original post:&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;EM&gt;CALCULATE(SUM(FactTable[amount_base]),&amp;nbsp;DATESBETWEEN(DimTable[business_date],&amp;nbsp;[opening_date_range],&amp;nbsp;[closing_date_range])), this is very fast and no error returns.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this part fails when i tried to convert into an actual measure definition:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	
DEFINE MEASURE 'FactTable'[TEST] = 
	VAR __DS0FilterTable = 
		FILTER(
			KEEPFILTERS(VALUES('FactTable'[amount_base])),
			'FactTable'[amount_base] &amp;gt; 0
		)

	VAR _result = CALCULATE([sum_no_filter], __DS0FilterTable)
RETURN
	_result

EVALUATE
	// SUMMARIZECOLUMNS(
	// 	__DS0FilterTable,
	// 	"sum_no_filter", IGNORE('FactTable'[sum_no_filter])
	// )
{[TEST]}&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 08 Jul 2025 17:41:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4756919#M182139</guid>
      <dc:creator>dmkblesser</dc:creator>
      <dc:date>2025-07-08T17:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help: SUMX with filter exceeds the ROW limit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4757035#M182146</link>
      <description>&lt;P&gt;Can you show the error message in detail?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sounds like you are in direct query, are you?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2025 20:52:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4757035#M182146</guid>
      <dc:creator>FBergamaschi</dc:creator>
      <dc:date>2025-07-08T20:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help: SUMX with filter exceeds the ROW limit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4757051#M182152</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1287762" data-lia-user-login="FBergamaschi" class="lia-mention lia-mention-user"&gt;FBergamaschi&lt;/a&gt;&amp;nbsp;, the error message is:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;yes, it is DQ to AS: connecting to another semantic model&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2025 21:25:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4757051#M182152</guid>
      <dc:creator>dmkblesser</dc:creator>
      <dc:date>2025-07-08T21:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help: SUMX with filter exceeds the ROW limit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4757428#M182165</link>
      <description>&lt;P&gt;OK is this error coming from Desktop or Cloud or both?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 07:39:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4757428#M182165</guid>
      <dc:creator>FBergamaschi</dc:creator>
      <dc:date>2025-07-09T07:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help: SUMX with filter exceeds the ROW limit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4757612#M182172</link>
      <description>&lt;P&gt;You could try&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sum less than 0 =
VAR BaseTable =
    ADDCOLUMNS (
        FILTER (
            KEEPFILTERS ( VALUES ( 'FactTable'[amount_base] ) ),
            'FactTable'[amount_base] &amp;gt; 0
        ),
        "@num rows", CALCULATE ( COUNTROWS ( 'FactTable' ) )
    )
VAR Result =
    SUMX ( BaseTable, 'FactTable'[amount_base] * [@num rows] )
RETURN
    Result
&lt;/LI-CODE&gt;
&lt;P&gt;This may work depending on how many unique values you have in the amount base column.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 09:58:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4757612#M182172</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2025-07-09T09:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help: SUMX with filter exceeds the ROW limit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4757615#M182173</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403730" data-lia-user-login="dmkblesser" class="lia-mention lia-mention-user"&gt;dmkblesser&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Yes, your suggestion around pushing filters into the measure (instead of using SUMX(FILTER(...))) is absolutely valid &amp;nbsp;and works well to avoid hitting the row limit issue in large datasets or live semantic models.&lt;/P&gt;
&lt;P&gt;In my case, the issue was caused by this pattern.&lt;/P&gt;
&lt;PRE&gt;Test = CALCULATE(SUMX(FILTER(FactTable, FactTable[amount_base] &amp;gt; 0),FactTable[amount_base]),DATESBETWEEN(...))&lt;/PRE&gt;
&lt;P&gt;This was triggering the error. The resultset of a query to external data source has exceeded the maximum allowed size of '1000000', due to FILTER() attempting to materialize too many rows.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;The approach that finally worked &amp;nbsp;based on your advice was restructuring the measure like this.&lt;/P&gt;
&lt;PRE&gt;PositiveAmount = CALCULATE([sum_no_filter], FactTable[amount_base] &amp;gt; 0)&lt;/PRE&gt;
&lt;PRE&gt;sum_no_filter = CALCULATE(SUM(FactTable[amount_base]), DATESBETWEEN(DimTable[business_date], [opening_date_range], [closing_date_range]))&lt;/PRE&gt;
&lt;P&gt;This pattern avoids SUMX and heavy row context, and keeps the model fast and responsive even with large datasets or live connections. I just needed to restructure the logic as standalone measures instead of trying to wrap everything in one definition.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Akhil.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 10:00:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4757615#M182173</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-07-09T10:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help: SUMX with filter exceeds the ROW limit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4757895#M182188</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1287762" data-lia-user-login="FBergamaschi" class="lia-mention lia-mention-user"&gt;FBergamaschi&lt;/a&gt;&amp;nbsp;, I received from both end. Some additional info but may not help in this situation, on the service end, we are in F64&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 15:14:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4757895#M182188</guid>
      <dc:creator>dmkblesser</dc:creator>
      <dc:date>2025-07-09T15:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help: SUMX with filter exceeds the ROW limit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4757900#M182189</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;, I'm not sure if you are providing a summary or a solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. it did work with pushing the filter to the visual but it is not a solution since what if you need to add multiple measures to one visual? the visual filter may contradicts different measures and return blank value for the visual.&lt;/P&gt;&lt;P&gt;2. the resturcted measure does not work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 15:20:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4757900#M182189</guid>
      <dc:creator>dmkblesser</dc:creator>
      <dc:date>2025-07-09T15:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help: SUMX with filter exceeds the ROW limit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4758009#M182191</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;appears to be copy and pasting AI-generated content.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem here &lt;EM&gt;might&lt;/EM&gt; be that the formula engine is converting the filter condition&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;FactTable[amount_base] &amp;lt; 0&lt;/FONT&gt; into list of all negative amounts and applying that list as a filter. If there are more than 1 million distinct negative amounts, this causes the row limit problem.&lt;BR /&gt;&lt;BR /&gt;The goal is to find another way of doing this that doesn't materialize a large filter table like that but it's not easy to control how the optimizer decides to do things.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe try writing without a CALCULATE for this case and hope the optimizer can figure out how to run this without materializing the FILTER table.&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;VAR _Open = [opening_date_range]
VAR _Close = [closing_date_range]
VAR _Result =
    SUMX (
        FILTER (
            FactTable,
            FactTable[amount_base] &amp;lt; 0
                &amp;amp;&amp;amp; FactTable[date_col] &amp;gt;= _Open
                &amp;amp;&amp;amp; FactTable[date_col] &amp;lt;= _Close
        ),
        FactTable[amount_base]
    )
RETURN
    _Result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;(You'll need to replace [date_col] with the appropirate name of the column your fact table.)&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 17:35:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4758009#M182191</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2025-07-09T17:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help: SUMX with filter exceeds the ROW limit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4758086#M182193</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240987" data-lia-user-login="johnt75" class="lia-mention lia-mention-user"&gt;johnt75&lt;/a&gt;, that's a smart workaround. Thanks for sharing that. Can you help me understand it better? For testing purpose, I import my fact table and create a calculated table using the BaseTable formula you provided. It actually returns me over&lt;STRONG&gt; 5 mill rows&lt;/STRONG&gt;. I'm supurised to find that this `Sum less than 0` formula actually be able to return a value in the end.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;since my original formula has &lt;SPAN&gt;DATESBETWEEN(DimTable[business_date], [opening_date_range], [closing_date_range])), the&amp;nbsp;[opening_date_range] is a measure which adds some additional complexity. the &amp;nbsp;[opening_date_range] is actually = to the a value from a date slicer + 1 day.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Your solution worked perfectly with the open date slicer and closing date slicer but since the extra complexicity with&amp;nbsp;[opening_date_range], the end result is missing by a day's value.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried to put that logic on top of the formula you provided and then I'm getting the same error again.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do you know any way to fix that using Dax? From data model perspective, I can add a new column to be something like true_open_date. I appreciate your help on getting the foundamental part working. I will still accept as Solution&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 20:18:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4758086#M182193</guid>
      <dc:creator>dmkblesser</dc:creator>
      <dc:date>2025-07-09T20:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help: SUMX with filter exceeds the ROW limit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4758089#M182194</link>
      <description>&lt;P&gt;thanks buddy, unfortately I'm still getting the same error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The funny part is I'm basically converting a report using DQ connecting to the Data source (Databricks) to use DQ connecting to a semantic model with data imported. Both approaches have the same data, and both are using DQ connection. The original formula worked in the DQ to Databricks but doesnt work with DQ to AS.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 20:22:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4758089#M182194</guid>
      <dc:creator>dmkblesser</dc:creator>
      <dc:date>2025-07-09T20:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help: SUMX with filter exceeds the ROW limit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4758127#M182199</link>
      <description>&lt;P&gt;If you can add a new column, you can define the &lt;A href="https://dax.guide/sign/" target="_self"&gt;SIGN&lt;/A&gt;( FactTable[AmountBase] ) as a new column and write&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;CALCULATE (
    SUM ( FactTable[amount_base] ),
    FactTable[Sign] = -1,
    DATESBETWEEN (
        DimTable[business_date],
        [opening_date_range],
        [closing_date_range]
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 21:50:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4758127#M182199</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2025-07-09T21:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help: SUMX with filter exceeds the ROW limit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4758662#M182222</link>
      <description>&lt;P&gt;I think you can add the time intelligence logic like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sum less than 0 =
VAR BaseTable =
    CALCULATETABLE (
        ADDCOLUMNS (
            FILTER (
                KEEPFILTERS ( VALUES ( 'FactTable'[amount_base] ) ),
                'FactTable'[amount_base] &amp;gt; 0
            ),
            "@num rows", CALCULATE ( COUNTROWS ( 'FactTable' ) )
        ),
        DATESBETWEEN (
            DimTable[business_date],
            [opening_date_range],
            [closing_date_range]
        )
    )
VAR Result =
    SUMX ( BaseTable, 'FactTable'[amount_base] * [@num rows] )
RETURN
    Result
&lt;/LI-CODE&gt;
&lt;P&gt;By wrapping the entire ADDCOLUMNS inside the CALCULATETABLE both the filtering and the count of the number of rows will be done in a filter context which is restricted to the relevant dates.&lt;/P&gt;
&lt;P&gt;The thinking behind my approach was to limit the number of rows you have to iterate over to get the sum. By combining the value with the number of occurences you still get the right number but hopefully with fewer rows as there would be a smaller number of unique amounts. Given that it is still returning 5 million rows though that won't be enough.&lt;/P&gt;
&lt;P&gt;As you are able to make changes to the model, I think that creating aggregation tables might be the best option, depending on how many dimensions you need to be able to slice by, and the cardinality of those dimensions. If you are just slicing by date then creating a snapshot of each day should be doable, to store the total amount &amp;lt; 0 and the total amount &amp;gt;0 for each day. Your measures would then simply sum this aggregation table.&lt;/P&gt;
&lt;P&gt;For more on aggregation techniques you might find&amp;nbsp;&lt;A href="https://www.sqlbi.com/articles/optimizing-incremental-inventory-calculations-in-dax/" target="_self"&gt;https://www.sqlbi.com/articles/optimizing-incremental-inventory-calculations-in-dax/&lt;/A&gt;&amp;nbsp;useful.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 08:47:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4758662#M182222</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2025-07-10T08:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help: SUMX with filter exceeds the ROW limit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4759213#M182245</link>
      <description>&lt;P&gt;thank you so much&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240987" data-lia-user-login="johnt75" class="lia-mention lia-mention-user"&gt;johnt75&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;. The ideas and the info you provided are very helpful and inspiring.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to avoid making changes to the table schema and keep everything within a calculated measure as much as possible but I guess it just add too much overhead to make that work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 17:01:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Help-SUMX-with-filter-exceeds-the-ROW-limit/m-p/4759213#M182245</guid>
      <dc:creator>dmkblesser</dc:creator>
      <dc:date>2025-07-10T17:01:39Z</dc:date>
    </item>
  </channel>
</rss>

