<?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: SUMX &amp;amp; FILTER or SUM &amp;amp; CALCULATE: Best practice for summing subset of columns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/2130004#M48872</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/236628" target="_blank" rel="noopener"&gt;@AntrikshSharma&lt;/A&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you can find the time I would appreciate help in explaining the concept you just described.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Especially I would like to know what you said about the MAX function which is wrapped in the FILTER function, why its not evaluated row by row, although its actually inside the filter function, which is a iterator?:&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;Actually MAX here is not related to the Row context created by FILTER, MAX is being evaluated in the filter context that is outside CALCULATE, this is well understood by using Variables, here is arunning total patern using the same."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For me it is actually inside the Calculate function as well, because Calculate is outside of everything.&lt;/P&gt;&lt;P&gt;Also shouldn't Filter function works row by row?&amp;nbsp; Shouldn't MAX be the Max date from the whole table its is refering to and not only the Max Date until that row which is going to be evaluated? Looking The following seems to make sense but isn't going to work without aggregation:&lt;/P&gt;&lt;PRE&gt;FILTER ( ALL ( Dates ),&lt;FONT color="#0000FF"&gt; &lt;STRONG&gt;Dates[Date]&lt;/STRONG&gt;&lt;/FONT&gt; &amp;lt; &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;( Dates[Date] )&lt;/STRONG&gt;&lt;/FONT&gt; &lt;/PRE&gt;&lt;P&gt;instead of:&lt;/P&gt;&lt;PRE&gt;FILTER ( ALL ( Dates ),&lt;FONT color="#0000FF"&gt; &lt;STRONG&gt;Dates[Date]&lt;/STRONG&gt;&lt;/FONT&gt; &amp;lt; &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;MAX ( Dates[Date] )&lt;/STRONG&gt;&lt;/FONT&gt; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Why I'm asking that is because when I do the same kind of calculation in a calculated column inside a table variable I can write like this without problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Column=&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Var _TableVariable= Filter( 'Calendar', &lt;FONT color="#FF0000"&gt;'Calendar' [Date]&amp;gt;='Maintable'[BookingDate] &amp;amp;&amp;amp;&amp;nbsp;'Calendar' [Date]&amp;lt;='Maintable'[FinishDate] &amp;amp;&amp;amp;&lt;/FONT&gt; 'Calendar[Day]= "Monday"))&lt;BR /&gt;return&lt;BR /&gt;countrows(_TableVariable)&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Here I don't need to aggregate the dates, it knows automatically when I say&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp; 'Calendar' [Date]&amp;gt;='Maintable'[BookingDate] &amp;amp;&amp;amp;&amp;nbsp;'Calendar' [Date]&amp;lt;='Maintable'[FinishDate]&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000000"&gt;that I'm talking about ALL the Calendar Dates which are bigger than the booking dates and smaller than then the FinishDate when the specific fow in the calendar table got evaluated row by row.&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time.&lt;/P&gt;&lt;P&gt;Best regards.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Oct 2021 14:18:55 GMT</pubDate>
    <dc:creator>Applicable88</dc:creator>
    <dc:date>2021-10-12T14:18:55Z</dc:date>
    <item>
      <title>SUMX &amp; FILTER or SUM &amp; CALCULATE: Best practice for summing subset of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/1248552#M20528</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;quick question: If I want to sum a subset of a column, for example the sum of the sales of only red products, which approach is better suited?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.SUMX and FILTER&lt;/P&gt;&lt;PRE&gt;Red Sales 1 =&lt;BR /&gt;SUMX ( FILTER ( Sales; Sales[ProductColor] = "Red" ); Sales[Amount] )&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. CALCULATE and SUM&lt;/P&gt;&lt;PRE&gt;Red Sales 2 =&lt;BR /&gt;CALCULATE ( SUM ( Sales[Amount] ); Sales[ProductColor] = "Red" )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Lucas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 13:50:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/1248552#M20528</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-24T13:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX &amp; FILTER or SUM &amp; CALCULATE: Best practice for summing subset of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/1248560#M20529</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;- I prefer the first approach with SUMX. The reason is because it works in cases where you have a table variable as well as a physical table. Thus, it is much more flexible and can be used in more situations than the second. I tend not to use CALCULATE at all because whatever you can do with CALCULATE can be done other ways.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 13:55:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/1248560#M20529</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-07-24T13:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX &amp; FILTER or SUM &amp; CALCULATE: Best practice for summing subset of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/1248640#M20530</link>
      <description>&lt;P&gt;You should use 2 second version as CALCULATE evaluates its filter arguments first and once the filter context is modified it evaluates the first argument. And modifying filter context before evaluating something is efficient and a good practice. Also you get to reuse your base measure in all your other measure, for example if you create a Sales Amount measure like&amp;nbsp;SUM ( Sales[Amount] ) you can use it multiple time in other measure where you just want to modify the context in which the SUM is to be evaluated without rewriting the whole code again. example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;=
CALCULATE ( [Sales Amount], Dates[Year] = 2020, Customer[Continent] = "Asia" )&lt;/LI-CODE&gt;&lt;LI-CODE lang="php"&gt;=
CALCULATE ( [Sales Amount], Dates[Year] IN { 2020, 2019, 2018 } )&lt;/LI-CODE&gt;&lt;LI-CODE lang="php"&gt;=
CALCULATE (
    [Sales Amount],
    Customer[Gender] = "Male",
    Products[Color] IN { "Green", "Yellow", "White" },
    USERELATIONSHIP ( Dates[Date], Sales[Due Date] ),
    FILTER ( ALL ( Dates ), Dates[Date] &amp;lt; MAX ( Dates[Date] ) )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In case of the first option FILTER has to iterate probably a very huge table and check for rows where color is red, but in case of the second option&amp;nbsp;&amp;nbsp;Sales[ProductColor] = "Red" internally it expands to FILTER ( ALL (&amp;nbsp;Sales[ProductColor] ),&amp;nbsp;Sales[ProductColor] = "Red" ) since it use ALL and ALL returns unique product colors, that list is going to be really small, we are talking in hundreds or maybe tens, and iterating such a small list is much more efficient that iterating a table with millions or billions of rows to just check for red products and then do further iterations with SUMX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 14:47:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/1248640#M20530</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-07-24T14:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX &amp; FILTER or SUM &amp; CALCULATE: Best practice for summing subset of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/1248752#M20535</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="236628" data-lia-user-login="AntrikshSharma" class="lia-mention lia-mention-user"&gt;AntrikshSharma&lt;/a&gt;&amp;nbsp;Thanks for the clarification. I was leaning towards this solution, too.&lt;BR /&gt;&lt;BR /&gt;Could you do me another favor and answer a follow-up question to your answer?&lt;BR /&gt;&lt;BR /&gt;The third example you posted seems to be a calculation based on the running total / cummulative total pattern:&lt;/P&gt;&lt;PRE&gt;=&lt;BR /&gt;CALCULATE (&lt;BR /&gt;[Sales Amount],&lt;BR /&gt;Customer[Gender] = "Male",&lt;BR /&gt;Products[Color] IN { "Green", "Yellow", "White" },&lt;BR /&gt;USERELATIONSHIP ( Dates[Date], Sales[Due Date] ),&lt;BR /&gt;FILTER ( ALL ( Dates ),&lt;FONT color="#0000FF"&gt; &lt;STRONG&gt;Dates[Date]&lt;/STRONG&gt;&lt;/FONT&gt; &amp;lt; &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;MAX ( Dates[Date] )&lt;/STRONG&gt;&lt;/FONT&gt; )&lt;BR /&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I've used the pattern myself but I still get confused about the last part. Could you give me feedback If I've understood it correctly?&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;Dates[Date]&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;: refers to the column&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;MAX ( Dates[Date] ) &lt;/STRONG&gt;&lt;FONT color="#000000"&gt;: We're in the row context now. There is only one Date which we retrieve with the MAX() function. But since there is only one date anyway in theory we could also use the MIN() or SELECTEDVALUE() functions to get this date&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;Thanks in advance.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 15:05:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/1248752#M20535</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-24T15:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX &amp; FILTER or SUM &amp; CALCULATE: Best practice for summing subset of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/1248786#M20540</link>
      <description>&lt;P&gt;Actually MAX here is not related to the Row context created by FILTER, MAX is being evaluated in the filter context that is outside CALCULATE, this is well understood by using Variables, here is arunning total patern using the same.&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Running Total = 
VAR MaxDateInFilterContext = MAX ( Dates[Date] )
VAR MaxYear = YEAR ( MaxDateInFilterContext )
VAR DatesLessThanMaxDate =
    FILTER (
        ALL ( Dates[Date], Dates[Calendar Year Number] ),
        Dates[Date] &amp;lt;= MaxDateInFilterContext
            &amp;amp;&amp;amp; Dates[Calendar Year Number] = MaxYear
    )
VAR Result =
    CALCULATE (
        [Total Sales],
        DatesLessThanMaxDate
    )
RETURN
    Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;take a look at the below screenshot. When you are at 2nd January, what is the MAX date? it is 2nd and the amount is calculated for all dates less than 2nd which is returned by the variable DatesLessThanMaxDate , next DAX is evaluated for 3rd January, now what is the MAX value? it is 3rd January, similarly it is being checked for each cell of the report.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Hence yes, you can use MIN or SELECTEDVALUE but their values will not be related to the Row context created by FILTER&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 15:19:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/1248786#M20540</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-07-24T15:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX &amp; FILTER or SUM &amp; CALCULATE: Best practice for summing subset of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/1248825#M20542</link>
      <description>&lt;P&gt;Thanks again&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="236628" data-lia-user-login="AntrikshSharma" class="lia-mention lia-mention-user"&gt;AntrikshSharma&lt;/a&gt;&amp;nbsp;! I really appreciate that you took the time to write such a detailed explanation. This is a topic I was struggeling with for weeks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 15:30:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/1248825#M20542</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-24T15:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX &amp; FILTER or SUM &amp; CALCULATE: Best practice for summing subset of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/1248834#M20543</link>
      <description>You're welcome, feel free to ask more questions if something isn't clear. Have a great day!</description>
      <pubDate>Fri, 24 Jul 2020 15:31:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/1248834#M20543</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-07-24T15:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX &amp; FILTER or SUM &amp; CALCULATE: Best practice for summing subset of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/1249232#M20559</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;- Thanks for inspiring me today.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check out my latest article, CALCUHATE - Why I Don't Use DAX's CALCULATE Function.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/CALCUHATE-Why-I-Don-t-Use-DAX-s-CALCULATE-Function/ba-p/1248635" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/CALCUHATE-Why-I-Don-t-Use-DAX-s-CALCULATE-Function/ba-p/1248635&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 18:20:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/1249232#M20559</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-07-24T18:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX &amp; FILTER or SUM &amp; CALCULATE: Best practice for summing subset of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/2130004#M48872</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/236628" target="_blank" rel="noopener"&gt;@AntrikshSharma&lt;/A&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you can find the time I would appreciate help in explaining the concept you just described.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Especially I would like to know what you said about the MAX function which is wrapped in the FILTER function, why its not evaluated row by row, although its actually inside the filter function, which is a iterator?:&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;Actually MAX here is not related to the Row context created by FILTER, MAX is being evaluated in the filter context that is outside CALCULATE, this is well understood by using Variables, here is arunning total patern using the same."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For me it is actually inside the Calculate function as well, because Calculate is outside of everything.&lt;/P&gt;&lt;P&gt;Also shouldn't Filter function works row by row?&amp;nbsp; Shouldn't MAX be the Max date from the whole table its is refering to and not only the Max Date until that row which is going to be evaluated? Looking The following seems to make sense but isn't going to work without aggregation:&lt;/P&gt;&lt;PRE&gt;FILTER ( ALL ( Dates ),&lt;FONT color="#0000FF"&gt; &lt;STRONG&gt;Dates[Date]&lt;/STRONG&gt;&lt;/FONT&gt; &amp;lt; &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;( Dates[Date] )&lt;/STRONG&gt;&lt;/FONT&gt; &lt;/PRE&gt;&lt;P&gt;instead of:&lt;/P&gt;&lt;PRE&gt;FILTER ( ALL ( Dates ),&lt;FONT color="#0000FF"&gt; &lt;STRONG&gt;Dates[Date]&lt;/STRONG&gt;&lt;/FONT&gt; &amp;lt; &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;MAX ( Dates[Date] )&lt;/STRONG&gt;&lt;/FONT&gt; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Why I'm asking that is because when I do the same kind of calculation in a calculated column inside a table variable I can write like this without problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Column=&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Var _TableVariable= Filter( 'Calendar', &lt;FONT color="#FF0000"&gt;'Calendar' [Date]&amp;gt;='Maintable'[BookingDate] &amp;amp;&amp;amp;&amp;nbsp;'Calendar' [Date]&amp;lt;='Maintable'[FinishDate] &amp;amp;&amp;amp;&lt;/FONT&gt; 'Calendar[Day]= "Monday"))&lt;BR /&gt;return&lt;BR /&gt;countrows(_TableVariable)&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Here I don't need to aggregate the dates, it knows automatically when I say&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp; 'Calendar' [Date]&amp;gt;='Maintable'[BookingDate] &amp;amp;&amp;amp;&amp;nbsp;'Calendar' [Date]&amp;lt;='Maintable'[FinishDate]&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#000000"&gt;that I'm talking about ALL the Calendar Dates which are bigger than the booking dates and smaller than then the FinishDate when the specific fow in the calendar table got evaluated row by row.&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time.&lt;/P&gt;&lt;P&gt;Best regards.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 14:18:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/2130004#M48872</guid>
      <dc:creator>Applicable88</dc:creator>
      <dc:date>2021-10-12T14:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX &amp; FILTER or SUM &amp; CALCULATE: Best practice for summing subset of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/2130171#M48878</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="287137" data-lia-user-login="Applicable88" class="lia-mention lia-mention-user"&gt;Applicable88&lt;/a&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For me it is actually inside the Calculate function as well, because Calculate is outside of everything.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;That doesn't matter, CALCULATE prepares the new filter context by evaluating the filter argument like FILTER ( ... MAX )) in the original filter context that was active when CALCULATE was called. What is the original filter context here? the one created by the column in a report. Although Nested calculated may have different original filter context created by an outer CALCULATE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Also shouldn't Filter function works row by row? -&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FILTER does work row by row but when you use another function in the second argument of FILTER, then it doesn't depend on the row that is currently iterated unless that function is wrapped inside CALCULATE like CALCULATE ( MAX ) )&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Read this:&amp;nbsp;&lt;A href="https://forum.enterprisedna.co/t/max-date-date-measure-used-in-the-filter-function/20123/5" target="_blank"&gt;https://forum.enterprisedna.co/t/max-date-date-measure-used-in-the-filter-function/20123/5&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Shouldn't MAX be the Max date from the whole table its is refering to and not only the Max Date until that row which is going to be evaluated?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know why you are confused, you are thinking that MAX depends on the row iterated by FILTER but there is no relation between MAX and the currently iterated row in FILTER, simply put MAX is an aggregator that is evaluated in the original Filter context that is outside of CALCULATE (in this case)&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 15:17:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/2130171#M48878</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2021-10-12T15:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX &amp; FILTER or SUM &amp; CALCULATE: Best practice for summing subset of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/2142173#M49250</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="236628" data-lia-user-login="AntrikshSharma" class="lia-mention lia-mention-user"&gt;AntrikshSharma&lt;/a&gt;&amp;nbsp;thank you so much for your thorough explanation. The link you provided was of tremendous help.&amp;nbsp; Keep up the good work!&lt;/P&gt;&lt;P&gt;Best.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 06:39:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/2142173#M49250</guid>
      <dc:creator>Applicable88</dc:creator>
      <dc:date>2021-10-19T06:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX &amp; FILTER or SUM &amp; CALCULATE: Best practice for summing subset of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/2362359#M60418</link>
      <description>&lt;P&gt;&lt;div data-video-id="https://www.youtube.com/watch?v=HMtxENQCD_w&amp;amp;ab_channel=EnterpriseDNA" data-video-remote-vid="https://www.youtube.com/watch?v=HMtxENQCD_w&amp;amp;ab_channel=EnterpriseDNA" class="lia-video-container lia-media-is-center lia-media-size-custom"&gt;&lt;iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FHMtxENQCD_w%3Ffeature%3Doembed&amp;amp;display_name=YouTube&amp;amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DHMtxENQCD_w&amp;amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FHMtxENQCD_w%2Fhqdefault.jpg&amp;amp;type=text%2Fhtml&amp;amp;schema=youtube" allowfullscreen="" style="max-width: 100%"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a video for those who need more explanation on this topic.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 16:18:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/2362359#M60418</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2022-02-26T16:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX &amp; FILTER or SUM &amp; CALCULATE: Best practice for summing subset of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/3574373#M137802</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="236628" data-lia-user-login="AntrikshSharma" class="lia-mention lia-mention-user"&gt;AntrikshSharma&lt;/a&gt;&amp;nbsp;, id like to ask how we would know that this is happening internally.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;SPAN&gt;&amp;nbsp;-----but in case of the second option&amp;nbsp;&amp;nbsp;Sales[ProductColor] = "Red" internally it expands to FILTER ( ALL (&amp;nbsp;Sales[ProductColor] ),&amp;nbsp;Sales[ProductColor] = "Red" )-----&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;i know this much that &lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;SPAN&gt;Sales[ProductColor] = "Red"&amp;nbsp;&lt;FONT color="#000000"&gt;is a shorthand for&amp;nbsp;&lt;FONT color="#FF0000"&gt;FILTER(Sales,&amp;nbsp;Sales[ProductColor] = "Red").&amp;nbsp;&lt;FONT color="#000000"&gt;This much is given in the microsoft Learn documentation itself. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="andale mono,times" color="#FF0000"&gt;&lt;SPAN&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;If we cant tell that the filter&amp;nbsp; &lt;FONT color="#FF0000"&gt;Sales[ProductColor] = "Red"&lt;/FONT&gt; converts to&amp;nbsp;&lt;FONT color="#FF0000"&gt;FILTER ( ALL (&amp;nbsp;Sales[ProductColor] ),&amp;nbsp;Sales[ProductColor] = "Red" )&lt;/FONT&gt; as you said, we may not be able to establish the computational superiority of CALCULATE function when compared to SUMX iteration function here in this case (it may be more convenient but let us not consider the ease of use)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="andale mono,times"&gt;&lt;SPAN&gt;kindly help.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="andale mono,times"&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 12:44:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/3574373#M137802</guid>
      <dc:creator>i_am_krishna</dc:creator>
      <dc:date>2023-12-08T12:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: SUMX &amp; FILTER or SUM &amp; CALCULATE: Best practice for summing subset of columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/3580197#M138078</link>
      <description>&lt;P&gt;You can identify the expansion using DAX Studio &amp;gt; Logical Query Plan&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;There is no difference.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 16:32:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUMX-amp-FILTER-or-SUM-amp-CALCULATE-Best-practice-for-summing/m-p/3580197#M138078</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2023-12-12T16:32:48Z</dc:date>
    </item>
  </channel>
</rss>

