<?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: Is this even possible - dynamically &amp;quot;carry over&amp;quot; previous month values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-this-even-possible-dynamically-quot-carry-over-quot-previous/m-p/2565901#M73111</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you can create a calculated table to achieve your goal.&lt;/P&gt;
&lt;P&gt;My Sample:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Date table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Date =
ADDCOLUMNS (
    CALENDAR ( DATE ( 2021, 10, 01 ), DATE ( 2022, 03, 31 ) ),
    "Year", YEAR ( [Date] ),
    "Month", MONTH ( [Date] ),
    "YearMonth",
        YEAR ( [Date] ) * 100
            + MONTH ( [Date] )
)&lt;/LI-CODE&gt;
&lt;P&gt;Calculated table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 = 
VAR _GENERATE =
    GENERATE ( VALUES ( 'Table'[SKU] ), SUMMARIZE('Date',[Year],[Month],[YearMonth]) )
VAR _ADDCOLUMN =
    ADDCOLUMNS (
        _GENERATE,
        "MAXDATE", CALCULATE ( MAX ( 'Table'[Stock Date] ) ),
        "Value", CALCULATE ( SUM ( 'Table'[End of Month Value] ) )
    )
VAR _Fill =
    ADDCOLUMNS (
        _ADDCOLUMN,
        "FILL",
            VAR _MAXDATE_PREVIOUS =
                MAXX (
                    FILTER (
                        _ADDCOLUMN,
                        [YearMonth] &amp;lt; EARLIER ( [YearMonth] )
                            &amp;amp;&amp;amp; [SKU] = EARLIER ( [SKU] )
                    ),
                    [MAXDATE]
                )
            RETURN
                IF (
                    ISBLANK([Value]),
                    SUMX ( FILTER ( _ADDCOLUMN, [MAXDATE] = _MAXDATE_PREVIOUS ), [Value] ),
                    [Value]
                )
    )
RETURN
    _Fill&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jun 2022 08:07:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-06-08T08:07:28Z</dc:date>
    <item>
      <title>Is this even possible - dynamically "carry over" previous month values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-this-even-possible-dynamically-quot-carry-over-quot-previous/m-p/2553864#M72405</link>
      <description>&lt;P&gt;Hi Community, I'm not sure if this is even possible and I hope my explanation is not too confusing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a business case where an analysis is being done on inventory that is sitting unused on shelves, and calculating associated value of those products that are just sitting there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a calculated column that takes the sum of the stock value for each product, on the latest day of each month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would like to do is somehow "carry over" the last end of month value for each product, in perpetuity, to represent a product (and its associated value) remaining static if no further deliveries of that product are stocked AND if no further purchases of that product are made.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible? I have tried to illustrate what I would like to accomplish below. TIA for any insight!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 23:00:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-this-even-possible-dynamically-quot-carry-over-quot-previous/m-p/2553864#M72405</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-01T23:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Is this even possible - dynamically "carry over" previous month values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-this-even-possible-dynamically-quot-carry-over-quot-previous/m-p/2554055#M72413</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , You should create measure like &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Inventory / OnHand &lt;BR /&gt;[Intial Inventory] + CALCULATE(SUM(Table[Ordered]),filter(date,date[date] &amp;lt;=maxx(date,date[date]))) - CALCULATE(SUM(Table[Sold]),filter(date,date[date] &amp;lt;=maxx(date,date[date])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Inventory / OnHand &lt;BR /&gt;CALCULATE(firstnonblankvalue('Date'[Month]),sum(Table[Intial Inventory]),all('Date')) + CALCULATE(SUM(Table[Ordered]),filter(date,date[date] &amp;lt;=maxx(date,date[date]))) - CALCULATE(SUM(Table[Sold]),filter(date,date[date] &amp;lt;=maxx(date,date[date])))&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 02:38:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-this-even-possible-dynamically-quot-carry-over-quot-previous/m-p/2554055#M72413</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-06-02T02:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Is this even possible - dynamically "carry over" previous month values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-this-even-possible-dynamically-quot-carry-over-quot-previous/m-p/2565901#M73111</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you can create a calculated table to achieve your goal.&lt;/P&gt;
&lt;P&gt;My Sample:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Date table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Date =
ADDCOLUMNS (
    CALENDAR ( DATE ( 2021, 10, 01 ), DATE ( 2022, 03, 31 ) ),
    "Year", YEAR ( [Date] ),
    "Month", MONTH ( [Date] ),
    "YearMonth",
        YEAR ( [Date] ) * 100
            + MONTH ( [Date] )
)&lt;/LI-CODE&gt;
&lt;P&gt;Calculated table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 = 
VAR _GENERATE =
    GENERATE ( VALUES ( 'Table'[SKU] ), SUMMARIZE('Date',[Year],[Month],[YearMonth]) )
VAR _ADDCOLUMN =
    ADDCOLUMNS (
        _GENERATE,
        "MAXDATE", CALCULATE ( MAX ( 'Table'[Stock Date] ) ),
        "Value", CALCULATE ( SUM ( 'Table'[End of Month Value] ) )
    )
VAR _Fill =
    ADDCOLUMNS (
        _ADDCOLUMN,
        "FILL",
            VAR _MAXDATE_PREVIOUS =
                MAXX (
                    FILTER (
                        _ADDCOLUMN,
                        [YearMonth] &amp;lt; EARLIER ( [YearMonth] )
                            &amp;amp;&amp;amp; [SKU] = EARLIER ( [SKU] )
                    ),
                    [MAXDATE]
                )
            RETURN
                IF (
                    ISBLANK([Value]),
                    SUMX ( FILTER ( _ADDCOLUMN, [MAXDATE] = _MAXDATE_PREVIOUS ), [Value] ),
                    [Value]
                )
    )
RETURN
    _Fill&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 08:07:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Is-this-even-possible-dynamically-quot-carry-over-quot-previous/m-p/2565901#M73111</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-08T08:07:28Z</dc:date>
    </item>
  </channel>
</rss>

