<?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: Context Transition Different with Measure Reference Even with CALCULATE in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-Transition-Different-with-Measure-Reference-Even-with/m-p/2153656#M49675</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;, thank you for referring me to this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, while it's a helpful article, it does not address my original question. I understand that variables are evaluated in their original context.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The question, in essence, is why the two versions of Measure_2 above would yield different results. They both involve CALCULATE, so the same context transition should be ocurring.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Oct 2021 13:18:55 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-10-25T13:18:55Z</dc:date>
    <item>
      <title>Context Transition Different with Measure Reference Even with CALCULATE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-Transition-Different-with-Measure-Reference-Even-with/m-p/2141966#M49246</link>
      <description>&lt;P&gt;Hi, I'm struggling to grasp why I'm experiencing the following.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use a reference to Measure_1 (which begins with CALCULATE) in Measure_2, I get one result. When I simply copy the text from Measure_1 into Measure_2, I get another result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand that I should expect this if Measure_1 didn't begin with CALCULATE because of the context-transition ocurring with measure-references. However, since Measure_1 begins with CALCULATE, shouldn't the context-transition be the same regardless of if I reference Measure_1 or use its code? Why am I getting different results?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure_1 := 
CALCULATE (
    VALUES ( Date_Table[Week_ID] ),
    FILTER (
        Date_Table,
        Date_Table[Date] = MAX ( Sales_Table[Order_Date] )
    )
)

// Date_Table is marked as the date-table.

// Date_Table[Date]   1 -------------- *   Sales_Table[Order_Date]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure_2 :=
CALCULATE (
    SUM ( Sales_Table[Sales_Amount] ),
    FILTER ( Date_Table, Date_Table[Week_ID] = [Measure_1] )
)

/*

The above returns a different result than just copying the code from Measure_1 into Measure_2:

Measure_2 :=
CALCULATE (
    SUM ( Sales_Table[Sales_Amount] ),
    FILTER (
        Date_Table,
        Date_Table[Week_ID]
            = CALCULATE (
                VALUES ( Date_Table[Week_ID] ),
                FILTER ( Date_Table, Date_Table[Date] = MAX ( 'Sales_Table'[Order_Date] ) )
            )
    )
)

*/&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, I was expecting the results to be the same since CALCULATE begins Measure_1--i.e., context transition ocurring due to the implicit CALCULATE in the measure-reference or explicit CALCULATE in the pasted code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any guidance would be much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A specific reference to where I can find an explanation in the &lt;EM&gt;Definitive Guide to Dax&lt;/EM&gt; (or elsewhere online) would be appreciated as well if possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 04:29:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-Transition-Different-with-Measure-Reference-Even-with/m-p/2141966#M49246</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-19T04:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Context Transition Different with Measure Reference Even with CALCULATE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-Transition-Different-with-Measure-Reference-Even-with/m-p/2142051#M49248</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change VALUES in the Measure 1 to MAX and try that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;STRONG&gt;accepting&lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;it as the solution&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;to help the other members find it more quickly.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 05:22:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-Transition-Different-with-Measure-Reference-Even-with/m-p/2142051#M49248</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-10-19T05:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Context Transition Different with Measure Reference Even with CALCULATE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-Transition-Different-with-Measure-Reference-Even-with/m-p/2143299#M49278</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;&amp;nbsp;, thanks for your quick reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Week_ID is a text-column ("week 1", "week 2" etc.).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm more interested in learning why the result is different when CALCULATE is present in both methods; I was expecting the context-transition to be the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know why the results are different?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 13:39:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-Transition-Different-with-Measure-Reference-Even-with/m-p/2143299#M49278</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-19T13:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Context Transition Different with Measure Reference Even with CALCULATE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-Transition-Different-with-Measure-Reference-Even-with/m-p/2144077#M49307</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see this link:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://radacad.com/caution-when-using-variables-in-dax-and-power-bi" target="_blank"&gt;https://radacad.com/caution-when-using-variables-in-dax-and-power-bi&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;STRONG&gt;accepting&lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;it as the solution&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;to help the other members find it more quickly.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 20:36:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-Transition-Different-with-Measure-Reference-Even-with/m-p/2144077#M49307</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-10-19T20:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: Context Transition Different with Measure Reference Even with CALCULATE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-Transition-Different-with-Measure-Reference-Even-with/m-p/2153656#M49675</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;, thank you for referring me to this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, while it's a helpful article, it does not address my original question. I understand that variables are evaluated in their original context.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The question, in essence, is why the two versions of Measure_2 above would yield different results. They both involve CALCULATE, so the same context transition should be ocurring.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 13:18:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-Transition-Different-with-Measure-Reference-Even-with/m-p/2153656#M49675</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-25T13:18:55Z</dc:date>
    </item>
  </channel>
</rss>

