<?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: How to show the Opening Stock for a week as the Closing Stock for the previous week? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-the-Opening-Stock-for-a-week-as-the-Closing-Stock/m-p/4311556#M171227</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="598213" data-lia-user-login="k_r" class="lia-mention lia-mention-user"&gt;k_r&lt;/a&gt;&amp;nbsp;, Try using&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Opening Stock =&lt;BR /&gt;VAR CurrentWeek = SELECTEDVALUE(Stock_CLEAN[Week Index])&lt;BR /&gt;VAR PreviousWeek = CurrentWeek - 1&lt;BR /&gt;VAR PreviousWeekClosingStock = &lt;BR /&gt;CALCULATE(&lt;BR /&gt;[Closing Stock],&lt;BR /&gt;Stock_CLEAN[Week Index] = PreviousWeek&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;CurrentWeek = 0,&lt;BR /&gt;[Original Opening Stock],&lt;BR /&gt;PreviousWeekClosingStock&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2024 11:57:05 GMT</pubDate>
    <dc:creator>bhanu_gautam</dc:creator>
    <dc:date>2024-12-03T11:57:05Z</dc:date>
    <item>
      <title>How to show the Opening Stock for a week as the Closing Stock for the previous week?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-the-Opening-Stock-for-a-week-as-the-Closing-Stock/m-p/4311508#M171225</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I currently have this table that I've created using Original Opening Stock and Closing Stock measures.&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Besides Week Index 0, going forward from Week Index 1, I would like to have the Opening Stock for a week as the Closing Stock for the previous week. So for example, Week Index 2's Original Opening Stock should be equal to Week Index 1's Closing Stock.&lt;BR /&gt;&lt;BR /&gt;Is there a way to acheive this without circular dependency errors?&lt;BR /&gt;&lt;BR /&gt;The current DAX formula I have for the two measures are as follows:&lt;BR /&gt;&lt;BR /&gt;Original Opening Stock:&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM(Stock_CLEAN[Unrestricted PAC]),&lt;BR /&gt;Stock_CLEAN[Material] = SELECTEDVALUE(Stock_CLEAN[Material]),&lt;BR /&gt;Stock_CLEAN[Plnt] IN {"1100", "1500"}&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;Closing Stock:&lt;BR /&gt;[Opening Stock] - [Total Demand] + [Total Supply]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 11:29:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-the-Opening-Stock-for-a-week-as-the-Closing-Stock/m-p/4311508#M171225</guid>
      <dc:creator>k_r</dc:creator>
      <dc:date>2024-12-03T11:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to show the Opening Stock for a week as the Closing Stock for the previous week?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-the-Opening-Stock-for-a-week-as-the-Closing-Stock/m-p/4311556#M171227</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="598213" data-lia-user-login="k_r" class="lia-mention lia-mention-user"&gt;k_r&lt;/a&gt;&amp;nbsp;, Try using&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Opening Stock =&lt;BR /&gt;VAR CurrentWeek = SELECTEDVALUE(Stock_CLEAN[Week Index])&lt;BR /&gt;VAR PreviousWeek = CurrentWeek - 1&lt;BR /&gt;VAR PreviousWeekClosingStock = &lt;BR /&gt;CALCULATE(&lt;BR /&gt;[Closing Stock],&lt;BR /&gt;Stock_CLEAN[Week Index] = PreviousWeek&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;CurrentWeek = 0,&lt;BR /&gt;[Original Opening Stock],&lt;BR /&gt;PreviousWeekClosingStock&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 11:57:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-the-Opening-Stock-for-a-week-as-the-Closing-Stock/m-p/4311556#M171227</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2024-12-03T11:57:05Z</dc:date>
    </item>
  </channel>
</rss>

