<?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 with variable in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2544036#M71745</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="305529" data-lia-user-login="mgrayTCB" class="lia-mention lia-mention-user"&gt;mgrayTCB&lt;/a&gt;&amp;nbsp;in ms delay can you also add calculate on top of the date diff 4 rows before the end of the code&lt;/P&gt;</description>
    <pubDate>Fri, 27 May 2022 13:53:30 GMT</pubDate>
    <dc:creator>SpartaBI</dc:creator>
    <dc:date>2022-05-27T13:53:30Z</dc:date>
    <item>
      <title>Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2536454#M71294</link>
      <description>&lt;P&gt;when i calculate this average with two separate measures it works correctly but when I try to combine it into one meaure with an extra variable it stops working correctly. I am trying to calculate the average delay across mulitple selected projects. This two step method works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure 1&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MS Months Chg = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;SSdate&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;MINX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MilestoneSS&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;MilestoneSS[DateActOrEstSS]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;Curdate&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;Maxx&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Milestones&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Milestones[DateActOrEst]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DATEDIFF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SSdate&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Curdate&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;day&lt;/SPAN&gt;&lt;SPAN&gt;)/&lt;/SPAN&gt;&lt;SPAN&gt;30.4&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure 2 - this limits the list to only projects with changes &amp;lt;&amp;gt; 0 and produces the correct average&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MS Delay = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AVERAGEX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;values&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Project[ProjectName]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;[MS Months Chg]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[MS Months Chg]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I then tried to consolidate this into one measure and I no longer get the correct average but I dont understand why.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MS Months Chg2 = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;SSdate&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;MINX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MilestoneSS&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;MilestoneSS[DateActOrEstSS]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;Curdate&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;maxx&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Milestones&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Milestones[DateActOrEst]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;datechg&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;DATEDIFF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SSdate&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Curdate&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;day&lt;/SPAN&gt;&lt;SPAN&gt;)/&lt;/SPAN&gt;&lt;SPAN&gt;30.4&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AVERAGEX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Project&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;datechg&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;datechg&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I must be missing something silly.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 24 May 2022 13:45:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2536454#M71294</guid>
      <dc:creator>mgrayTCB</dc:creator>
      <dc:date>2022-05-24T13:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2536497#M71298</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;I beleive it's due to having multiple iterators with calculate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would somehing like this work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CombinedMeasure = IF(&lt;SPAN&gt;[MS Months Chg]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;0, [MS Months Change], BLANK())&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 13:58:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2536497#M71298</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-05-24T13:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2536793#M71324</link>
      <description>&lt;P&gt;the combined measure that is not working is the one with the variable datechg. I tried that if statement there but it does not help. Any other ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 15:35:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2536793#M71324</guid>
      <dc:creator>mgrayTCB</dc:creator>
      <dc:date>2022-05-24T15:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2537027#M71338</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;If you have sample data it will be easier to try to solve. Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 17:07:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2537027#M71338</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-05-24T17:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2537210#M71350</link>
      <description>&lt;P&gt;See the sample data here&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1F-60fTrgFjDy53ycBb7uqlwDEjcNleP1/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1F-60fTrgFjDy53ycBb7uqlwDEjcNleP1/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why does the two step measure approch provide the correct average while the AllInOneMeasure does not.&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 19:15:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2537210#M71350</guid>
      <dc:creator>mgrayTCB</dc:creator>
      <dc:date>2022-05-24T19:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2538741#M71449</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;I did not see Milestones field? I have updated a few things but not traking on the measures you mentioned regarding Milestones.&lt;/P&gt;&lt;P&gt;&lt;A title="Budget vs Actual by Project" href="https://drive.google.com/file/d/1PhhAyK-UJO7xWJocDYgh3VhzM4X-_hM9/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1PhhAyK-UJO7xWJocDYgh3VhzM4X-_hM9/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both FILTER &amp;amp; the X functions are iterators. When used together with calculate you can get unexpected results. The second iterator has another row context vs first iterator.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note - I know you are looking for average differences. Is this for just for months with data or by month even though there is no data?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks..&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 11:35:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2538741#M71449</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-05-25T11:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2538780#M71453</link>
      <description>&lt;P&gt;I think I may have shared the wrong file. Try this one.&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1MePchJEuDLB1UF6gDvrvX88Rx9WbKdWS/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1MePchJEuDLB1UF6gDvrvX88Rx9WbKdWS/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The milestone field is called Mstype but should not matter for this calculation.&lt;/P&gt;&lt;P&gt;I am try to calculate the average delay all in one measure but can only get the write answer if I do it in two steps.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;5.75 is the right answer - it is the averagex of the displayed projects.&amp;nbsp; 24.47 is not the average of each it is the delay between the earlist date (DateActOrEstSS) and the max of the the latest (DateActOrEst).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just dont understand what I am doing wrong in the DelayAllInOneMeasure and not able to get 5.75&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 11:52:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2538780#M71453</guid>
      <dc:creator>mgrayTCB</dc:creator>
      <dc:date>2022-05-25T11:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2540122#M71528</link>
      <description>&lt;P&gt;Hi MGray:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry it's taken a while. It's a tricky one and I have a question. I will paste two examples of filtered data to ask you what is the correct answer you desire? I will also attach the file as I added a date table and have a few measures in "New Calculations" table.&lt;/P&gt;&lt;P&gt;Here are a couple of possible discrepancies: What should the answer be?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Once we know how to handle these, I think we can arrive at a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks..&lt;A title="Sample Problem" href="https://drive.google.com/file/d/13V1MW5t98F67ygXf3_rFEYmq8S2uW-Id/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/13V1MW5t98F67ygXf3_rFEYmq8S2uW-Id/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 00:59:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2540122#M71528</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-05-26T00:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2541363#M71582</link>
      <description>&lt;P&gt;Thanks for diggin into this. I am not following what your question is. The measure DelayStep2 provides the correct answer (average project milestone delay) but relys on a intrim measure DelayStep1. All I am trying to do is get the same answer but all in one measure. When I do it all in one measure how do I get datechange to calculate row by row?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 11:48:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2541363#M71582</guid>
      <dc:creator>mgrayTCB</dc:creator>
      <dc:date>2022-05-26T11:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2541476#M71589</link>
      <description>&lt;P&gt;Good am:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question are that the two examples show the data from the table flitered down to two specific locations. I am trying to ask what answer do you want? I'll explain example one below. Proj New 125 Am only has one entry. Over a two month period the delay is 65 days. The average delay measure shows 2.14.(no filters). Is 2.14 correct? 65/30.4. I was thinging a 65 day delay over approx two months could result in a result of 65/2 = 32.5?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As we look at(I pasted yesterday example #2). TCB Park H. It has 5 entries. Only one have info (28 days over about one month). Your measure results in 6.51 and mine is .92.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Basically, Im just checking in on the math you want to use for the calculation. Right now I'm using a monthly average.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope these questions make sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you..&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 12:52:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2541476#M71589</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-05-26T12:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2541756#M71608</link>
      <description>&lt;P&gt;Thank you for explaining. In both of those filtered cases the answer would be the one number that shows.&lt;/P&gt;&lt;P&gt;So for TCB Park H we would not average in all the zeros (they would be filtered out of the result). That is what the AverageX of the filtered table does in my working measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The average I am looking for is the average of those milestones that have delay &amp;lt;&amp;gt; 0&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 15:16:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2541756#M71608</guid>
      <dc:creator>mgrayTCB</dc:creator>
      <dc:date>2022-05-26T15:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2541912#M71619</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;I'm having trouble trying to match your figure.&amp;nbsp;&lt;A title="Avg Delays" href="https://drive.google.com/file/d/13V1MW5t98F67ygXf3_rFEYmq8S2uW-Id/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/13V1MW5t98F67ygXf3_rFEYmq8S2uW-Id/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm hoping one of the experts on here can help? The file attached has some new overview calculations that could save some time figuring this out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry I couldn't match or misunderstanding...&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 16:55:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2541912#M71619</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-05-26T16:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2542050#M71630</link>
      <description>&lt;P&gt;Maybe I will repost with a differnt subject. Thanks for trying&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 18:04:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2542050#M71630</guid>
      <dc:creator>mgrayTCB</dc:creator>
      <dc:date>2022-05-26T18:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2542081#M71632</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="305529" data-lia-user-login="mgrayTCB" class="lia-mention lia-mention-user"&gt;mgrayTCB&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;The var for scalar values are fixed after their execution in the original filter context.&amp;nbsp;&lt;BR /&gt;try this:&lt;/P&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;MS Months Chg2 =
AVERAGEX (
    FILTER (
        Project,
        VAR SSdate =
            CALCULATE ( MINX ( MilestoneSS, MilestoneSS[DateActOrEstSS] ) )
        VAR Curdate =
            CALCULATE ( MAXX ( Milestones, Milestones[DateActOrEst] ) )
        VAR datechg =
            DATEDIFF ( SSdate, Curdate, DAY ) / 30.4
        RETURN
            datechg &amp;lt;&amp;gt; 0
    ),
    VAR SSdate =
        CALCULATE ( MINX ( MilestoneSS, MilestoneSS[DateActOrEstSS] ) )
    VAR Curdate =
        CALCULATE ( MAXX ( Milestones, Milestones[DateActOrEst] ) )
    VAR datechg =
        DATEDIFF ( SSdate, Curdate, DAY ) / 30.4
    RETURN
        datechg
)&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;P&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Data-Stories-Gallery/Contoso-by-SpartaBI/m-p/2449543" target="_blank" rel="noopener"&gt;&lt;FONT size="4" color="#0000EE"&gt;Showcase Report – Contoso By SpartaBI&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="https://www.spartabi.com" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;A href="https://www.linkedin.com/company/spartabi" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt; &amp;nbsp;&amp;nbsp;&lt;A href="https://www.facebook.com/SpartaBI" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.spartabi.com" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 19:29:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2542081#M71632</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-05-26T19:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2542142#M71638</link>
      <description>&lt;P&gt;Thank you that makes sense regarding the scalars getting fixed and I understand the logic of your revised measure but the last reference to the "datechg" as the expression term of the AverageX seems to be out of scope or something. See below.&lt;/P&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 19:16:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2542142#M71638</guid>
      <dc:creator>mgrayTCB</dc:creator>
      <dc:date>2022-05-26T19:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2542178#M71643</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="305529" data-lia-user-login="mgrayTCB" class="lia-mention lia-mention-user"&gt;mgrayTCB&lt;/a&gt;&amp;nbsp;hey, yes, I actually fixed that 20 minutes ago in the original message but seems I didn't click post haha &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; One sec, will update the original code&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 19:29:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2542178#M71643</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-05-26T19:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2542184#M71645</link>
      <description>&lt;P&gt;Thank you. I see you need to re do it all.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 19:30:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2542184#M71645</guid>
      <dc:creator>mgrayTCB</dc:creator>
      <dc:date>2022-05-26T19:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2542188#M71646</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="305529" data-lia-user-login="mgrayTCB" class="lia-mention lia-mention-user"&gt;mgrayTCB&lt;/a&gt;&amp;nbsp;yep, I actually will write something I think is a better version from performance view. One minute.&lt;BR /&gt;&lt;BR /&gt;P.S.&lt;BR /&gt;Check out my showcase report:&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543" target="_blank"&gt;https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543&lt;/A&gt;&lt;BR /&gt;Give it a thumbs up if you liked it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 19:32:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2542188#M71646</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-05-26T19:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2542195#M71648</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="305529" data-lia-user-login="mgrayTCB" class="lia-mention lia-mention-user"&gt;mgrayTCB&lt;/a&gt;&amp;nbsp;try this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MS Months Chg2 =
AVERAGEX (
    FILTER (
        ADDCOLUMNS (
            Project,
            "@datechg",
                VAR SSdate =
                    CALCULATE ( MINX ( MilestoneSS, MilestoneSS[DateActOrEstSS] ) )
                VAR Curdate =
                    CALCULATE ( MAXX ( Milestones, Milestones[DateActOrEst] ) )
                VAR datechg =
                    DATEDIFF ( SSdate, Curdate, DAY ) / 30.4
                RETURN
                    datechg
        ),
        [@datechg] &amp;lt;&amp;gt; 0
    ),
    [@datechg]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Data-Stories-Gallery/Contoso-by-SpartaBI/m-p/2449543" target="_blank" rel="noopener"&gt;&lt;FONT size="4" color="#0000EE"&gt;Showcase Report – Contoso By SpartaBI&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="https://www.spartabi.com" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;A href="https://www.linkedin.com/company/spartabi" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt; &amp;nbsp;&amp;nbsp;&lt;A href="https://www.facebook.com/SpartaBI" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.spartabi.com" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 19:35:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2542195#M71648</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-05-26T19:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Context transition with variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2542199#M71649</link>
      <description>&lt;P&gt;Thank you so much! I was wondering about performance and before I could even test it in my model you rewrote it. I have never seen the "@" syntax. Is that just your convention for columns of virutal tables?&lt;/P&gt;&lt;P&gt;thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 19:46:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Context-transition-with-variable/m-p/2542199#M71649</guid>
      <dc:creator>mgrayTCB</dc:creator>
      <dc:date>2022-05-26T19:46:15Z</dc:date>
    </item>
  </channel>
</rss>

