<?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: previous Year Last day value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-Year-Last-day-value/m-p/1145309#M17255</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="4037" data-lia-user-login="stevedep" class="lia-mention lia-mention-user"&gt;stevedep&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for to find out the&amp;nbsp; year last day inventory available value .&lt;/P&gt;&lt;P&gt;Ex, 2020 should show the value captured on 31 may 2020 only , not the cumlative jan 1 2020 to may 31 2020 .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jun 2020 14:04:03 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-06-08T14:04:03Z</dc:date>
    <item>
      <title>previous Year Last day value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-Year-Last-day-value/m-p/1145240#M17251</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got requirement to calculate latest inventory&amp;nbsp; below condition .&lt;/P&gt;&lt;P&gt;My matrix report structure below :&amp;nbsp;&lt;/P&gt;&lt;P&gt;Year&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2018&amp;nbsp; 2019 2020&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inventory&amp;nbsp; 50.&amp;nbsp; &amp;nbsp; &amp;nbsp;60.&amp;nbsp; &amp;nbsp; &amp;nbsp;70&amp;nbsp;&lt;/P&gt;&lt;P&gt;Above actually drill down report . Year &amp;amp; month level .&lt;/P&gt;&lt;P&gt;1 . I want show last day of year value&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex . In 2018 below it should show only 31 dec 2018 inventory value .&lt;/P&gt;&lt;P&gt;2. again if they drill down to month level I want to see each month last day value&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex , report like below&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Year&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2018&amp;nbsp;&lt;/P&gt;&lt;P&gt;Month&amp;nbsp; &amp;nbsp; &amp;nbsp;31jan&amp;nbsp; 28 Feb&amp;nbsp; 31 March. .. etc&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inventory&amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp;etc ..&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;P&gt;They want to latest value&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;</description>
      <pubDate>Mon, 08 Jun 2020 14:02:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-Year-Last-day-value/m-p/1145240#M17251</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-08T14:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: previous Year Last day value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-Year-Last-day-value/m-p/1145293#M17254</link>
      <description>&lt;P&gt;For the latest stock you can look at:&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/Stuck-in-DAX-Create-calculated-table-from-date-based-last-values/m-p/1132982/highlight/true#M16845" target="_blank"&gt;https://community.powerbi.com/t5/DAX-Commands-and-Tips/Stuck-in-DAX-Create-calculated-table-from-date-based-last-values/m-p/1132982/highlight/true#M16845&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jun 2020 08:11:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-Year-Last-day-value/m-p/1145293#M17254</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-06T08:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: previous Year Last day value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-Year-Last-day-value/m-p/1145309#M17255</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="4037" data-lia-user-login="stevedep" class="lia-mention lia-mention-user"&gt;stevedep&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for to find out the&amp;nbsp; year last day inventory available value .&lt;/P&gt;&lt;P&gt;Ex, 2020 should show the value captured on 31 may 2020 only , not the cumlative jan 1 2020 to may 31 2020 .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2020 14:04:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-Year-Last-day-value/m-p/1145309#M17255</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-08T14:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: previous Year Last day value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-Year-Last-day-value/m-p/1145311#M17256</link>
      <description>&lt;P&gt;Last day inventory is the latest stock part, dateadd minus 1 year to see the value of the year before?&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jun 2020 09:23:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-Year-Last-day-value/m-p/1145311#M17256</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-06T09:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: previous Year Last day value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-Year-Last-day-value/m-p/1146035#M17306</link>
      <description>&lt;P&gt;Your requirements are not totally clear... but you might try this:&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;[Your Transformed Measure] =
SWITCH( TRUE(),
	ISINSCOPE( Date[Month] ),
		CALCULATE(
			[Your Base Measure],
			LASTDATE( Date[Date] )
		),		
	ISINSCOPE( Date[Year] ),	
		CALCULATE(
			[Your Base Measure],
			SAMEPERIODLASTYEAR(
				LASTDATE( Date[Date] )
			)
		)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jun 2020 19:56:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-Year-Last-day-value/m-p/1146035#M17306</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-07T19:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: previous Year Last day value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-Year-Last-day-value/m-p/1147065#M17345</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="4037" data-lia-user-login="stevedep" class="lia-mention lia-mention-user"&gt;stevedep&lt;/a&gt;&amp;nbsp; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;In short my requirements are :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for to find out the latest inventory value of the year .&lt;/P&gt;&lt;P&gt;For ex ,&lt;/P&gt;&lt;P&gt;1.2018 , measure should show the value on 31dec 2018&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. 2019 , measure should show the 31dec 2019 value&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. 2020 should show the value captured till last complete month 31 may 2020 only , not the cumlative jan 1 2020 to june 8th 2020 .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2020 14:08:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-Year-Last-day-value/m-p/1147065#M17345</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-08T14:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: previous Year Last day value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-Year-Last-day-value/m-p/1147439#M17361</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Its working on month level, but I am not able (yet) to get it working on year level:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LastestStock = 
var __DateInContext = MAX(DateDimv2[Date].[Date])
var __PreviousMonth = CALCULATE(MAX(DateDimv2[Date]);ALL(DateDimv2[Date]);PREVIOUSMONTH(DateDimv2[Date]))
var __LastKnownDate = 
CALCULATE (
    LASTNONBLANK (
        DateDimv2[Date];
       CALCULATE(SUM('Fact-DailyStock'[Stock]))
    );
    DateDimv2[Date] &amp;lt; __DateInContext
)
var __LastKnownDatePreviousMonth =
CALCULATE (
    LASTNONBLANK (
        DateDimv2[Date];
       CALCULATE(SUM('Fact-DailyStock'[Stock]))
    );
    DateDimv2[Date] &amp;lt; __PreviousMonth
)
return 
if(EOMONTH(TODAY();0)&amp;lt;EOMONTH(__DateInContext;0);BLANK();
    if(
    EOMONTH(TODAY();0) &amp;gt; EOMONTH(__DateInContext;0);
    CALCULATE(CALCULATE(SUM('Fact-DailyStock'[Stock])); FILTER(ALL(DateDimv2[Date]);DateDimv2[Date]=__LastKnownDate));
    CALCULATE(CALCULATE(SUM('Fact-DailyStock'[Stock])); FILTER(ALL(DateDimv2[Date]);DateDimv2[Date]=__LastKnownDatePreviousMonth)))
)  &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Link to Power BI file &lt;A href="https://1drv.ms/u/s!AvU6hhKLfmEcgdgP59NnMpyF-pBzmg?e=edDKkK" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps though (who cares about year level anyways ;-).&lt;BR /&gt;Kind regards, Steve.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2020 18:47:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-Year-Last-day-value/m-p/1147439#M17361</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-08T18:47:48Z</dc:date>
    </item>
  </channel>
</rss>

