<?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: Max Value of Running Total per Year -&amp;gt; want to exclude current Year from Max in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Max-Value-of-Running-Total-per-Year-gt-want-to-exclude-current/m-p/1809535#M38214</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="298218" data-lia-user-login="Fromit87" class="lia-mention lia-mention-user"&gt;Fromit87&lt;/a&gt; , you should be able to use datesytd on top or first formula, because it can end date of choice &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example&lt;/P&gt;
&lt;P&gt;MAX_RT = &lt;BR /&gt;CALCULATE(&lt;BR /&gt;MAXX(values(FY_CAL[FSCL_YR]),SALES[RT_MONTH]) , datesytd('Date'[Date], "3/31"))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This Year = CALCULATE(MAXX(values(FY_CAL[FSCL_YR]),SALES[RT_MONTH]) ,filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;radacad&lt;/A&gt; &lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;sqlbi&lt;/A&gt; &lt;A href="https://www.youtube.com/playlist?list=PLPaNVDMhUXGYLz-w8ERQOo3KYARs7GgG-" target="_blank"&gt;My Video Series&lt;/A&gt; Appreciate your Kudos. &lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Apr 2021 17:30:26 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2021-04-27T17:30:26Z</dc:date>
    <item>
      <title>Max Value of Running Total per Year -&gt; want to exclude current Year from Max</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Max-Value-of-Running-Total-per-Year-gt-want-to-exclude-current/m-p/1809330#M38207</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I have a measure RT_MONTH calculating the running total of unit sales per fiscal month/year.&lt;/P&gt;&lt;P&gt;With a second measure MAX_RT, I identified the max value per month for the annual running totals.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MAX_RT = 
CALCULATE(
    MAXX(values(FY_CAL[FSCL_YR]),SALES[RT_MONTH]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That works as intended, but it obviously includes data for the current fiscal year, which I need to avoid.&lt;/P&gt;&lt;P&gt;How do I adjust my MAX_RT measure to return the max value for the last 5 fiscal years, but excluding the current fiscal year?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If I look at the example of January, the value of 18 as a result of MAX_RT (left table) comes from fiscal year 2021 (right table).&lt;STRONG&gt;&lt;img /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The current fiscal year is identified by (I cannot use time intelligence, as fiscal years, fiscal months deviate from calendar yrs/months):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR CurrentFY = LOOKUPVALUE(FY_CAL[FSCL_YR],FY_CAL[CAL_DT],TODAY())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H4&gt;FY_CAL is the date table with a 1:* relationship of column FY_CAL[CAL_DT] to SALES[DATE_SOLD]&amp;nbsp;&lt;/H4&gt;&lt;P&gt;Any help is highly appreciated. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 15:43:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Max-Value-of-Running-Total-per-Year-gt-want-to-exclude-current/m-p/1809330#M38207</guid>
      <dc:creator>Fromit87</dc:creator>
      <dc:date>2021-04-27T15:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Max Value of Running Total per Year -&gt; want to exclude current Year from Max</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Max-Value-of-Running-Total-per-Year-gt-want-to-exclude-current/m-p/1809535#M38214</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="298218" data-lia-user-login="Fromit87" class="lia-mention lia-mention-user"&gt;Fromit87&lt;/a&gt; , you should be able to use datesytd on top or first formula, because it can end date of choice &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example&lt;/P&gt;
&lt;P&gt;MAX_RT = &lt;BR /&gt;CALCULATE(&lt;BR /&gt;MAXX(values(FY_CAL[FSCL_YR]),SALES[RT_MONTH]) , datesytd('Date'[Date], "3/31"))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This Year = CALCULATE(MAXX(values(FY_CAL[FSCL_YR]),SALES[RT_MONTH]) ,filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;radacad&lt;/A&gt; &lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;sqlbi&lt;/A&gt; &lt;A href="https://www.youtube.com/playlist?list=PLPaNVDMhUXGYLz-w8ERQOo3KYARs7GgG-" target="_blank"&gt;My Video Series&lt;/A&gt; Appreciate your Kudos. &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 17:30:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Max-Value-of-Running-Total-per-Year-gt-want-to-exclude-current/m-p/1809535#M38214</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-04-27T17:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Max Value of Running Total per Year -&gt; want to exclude current Year from Max</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Max-Value-of-Running-Total-per-Year-gt-want-to-exclude-current/m-p/1810859#M38243</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;Thank you for your reply!&lt;/P&gt;&lt;P&gt;The moment I add a filter to the MAX_RT measure, it returns no longer the maximum running totals per month, but only the maximum values per month (separately, not cumulative anymore).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MAX_RT =&lt;BR /&gt;CALCULATE(MAXX(values(FY_CAL[FSCL_YR]),SALES[RT_MONTH]),FILTER('FY_CAL','FY_CAL'[FSCL_YR]&amp;lt;2021))&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 08:30:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Max-Value-of-Running-Total-per-Year-gt-want-to-exclude-current/m-p/1810859#M38243</guid>
      <dc:creator>Fromit87</dc:creator>
      <dc:date>2021-04-28T08:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Max Value of Running Total per Year -&gt; want to exclude current Year from Max</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Max-Value-of-Running-Total-per-Year-gt-want-to-exclude-current/m-p/1811811#M38278</link>
      <description>&lt;P&gt;I finally got it to work. Seems, that I mixed MAXX with CALCULATE. I have a column in my date table, that identifies previous fiscal years by -1,-2,-3 etc., the current fiscal year is 0. That way I filtered the table values of fiscal year to include everything but the current year. Then the measure resulted in the max value for previous years, excluding the current year.&lt;BR /&gt;&lt;BR /&gt;From a performance perspective CALCUALTETABLE might not be ideal, but I don't know if there is an easier way with the same result.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MAX_RT =
MAXX (
    CALCULATETABLE (
        VALUES ( 'FY_CAL'[FSCL_YR] ),
        FILTER ( FY_CAL, FY_CAL[FSCL_YR_DIFF_CNT] &amp;lt; 0 )
    ),
    CALCULATE ( [RT_MONTH] )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 14:48:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Max-Value-of-Running-Total-per-Year-gt-want-to-exclude-current/m-p/1811811#M38278</guid>
      <dc:creator>Fromit87</dc:creator>
      <dc:date>2021-04-28T14:48:59Z</dc:date>
    </item>
  </channel>
</rss>

