<?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: Actual previous year until the last sales day in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3121915#M110748</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="107078" data-lia-user-login="Raph" class="lia-mention lia-mention-user"&gt;Raph&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would you please explain again what exactly the value are you exyto see for each date?&lt;/P&gt;</description>
    <pubDate>Thu, 09 Mar 2023 15:23:57 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2023-03-09T15:23:57Z</dc:date>
    <item>
      <title>Actual previous year until the last sales day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3121296#M110691</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a visual displaying the days of the month (1 march, 2 march, 3 march, without the year) showing the sales of the day of the current year and the sales of the day of the previous year :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-120px"&gt;2023&amp;nbsp; &amp;nbsp; &amp;nbsp; 2022&lt;/P&gt;&lt;P&gt;1 March&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 8&lt;/P&gt;&lt;P&gt;2 March&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&lt;/P&gt;&lt;P&gt;3 March&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;/P&gt;&lt;P&gt;4 March&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's say today is 2 March 2023 and I would like the figures of the previous year showed only until 2 March 2022.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the following code but it keeps showing data until 4 March for the previous year like above :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Actual previous year = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; LastSalesDate = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;('Sales [Date]),&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DATEADD&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sales'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;,-&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; SalesPrevYear = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;([Total Sales],&lt;/SPAN&gt;&lt;SPAN&gt;SAMEPERIODLASTYEAR&lt;/SPAN&gt;&lt;SPAN&gt;('Date'[day]))&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;(ActuPrevYear,&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;('Date','Date'[Day]&amp;lt;=LastSalesDate))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Raphaël&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 11:06:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3121296#M110691</guid>
      <dc:creator>Raph</dc:creator>
      <dc:date>2023-03-09T11:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Actual previous year until the last sales day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3121383#M110697</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="107078" data-lia-user-login="Raph" class="lia-mention lia-mention-user"&gt;Raph&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Actual previous year =
VAR LastSalesDate =
    CALCULATE ( MAX ( 'Sales'[Date] ), REMOVEFILTERS () )
VAR Dates =
    FILTER (
        PREVIOUSYEAR ( 'Date'[Date] ),
        FORMAT ( 'Date'[Date], "MMDD" ) &amp;lt;= FORMAT ( LastSalesDate, "MMDD" )
    )
RETURN
    CALCULATE ( [Total Sales], Dates )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 12:01:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3121383#M110697</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-09T12:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Actual previous year until the last sales day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3121595#M110722</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for you answered which looked smart to me.&lt;/P&gt;&lt;P&gt;I tried it but now I have a big number, always the same, repeating on all the rows of the month... typically like a data modeling problem.&amp;nbsp; The model is really very simple : 2 dim tables (date and stores) linked to 2 fact tables (sales and budget).&lt;/P&gt;&lt;P&gt;This worked well for the budget :&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Budget € = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;LastSalesDate&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sales'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sales&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;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Budget&lt;/SPAN&gt;&lt;SPAN&gt;[Budget]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;SPAN&gt;[Day]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;=&lt;/SPAN&gt;&lt;SPAN&gt;LastSalesDate&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Raphaël&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 Mar 2023 13:34:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3121595#M110722</guid>
      <dc:creator>Raph</dc:creator>
      <dc:date>2023-03-09T13:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Actual previous year until the last sales day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3121619#M110723</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="107078" data-lia-user-login="Raph" class="lia-mention lia-mention-user"&gt;Raph&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Seems I misunderstood the requirement. Please try&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Actual previous year =
VAR CurrentDate =
    MAX ( 'Date'[Date] )
VAR Dates =
    FILTER (
        PREVIOUSYEAR ( 'Date'[Date] ),
        FORMAT ( 'Date'[Date], "MMDD" ) &amp;lt;= FORMAT ( CurrentDate, "MMDD" )
    )
RETURN
    CALCULATE ( [Total Sales], Dates )&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 09 Mar 2023 13:41:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3121619#M110723</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-09T13:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: Actual previous year until the last sales day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3121692#M110729</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you. It stops now at the right date but figures are not correct, all much too high (but not all the same).&lt;/P&gt;&lt;P&gt;This returns the good numbers but don't stop at the right date :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Actual previous year = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; MaxDatePrevYear = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;('Sales conso'[Finalized Date]),&lt;/SPAN&gt;&lt;SPAN&gt;SAMEPERIODLASTYEAR&lt;/SPAN&gt;&lt;SPAN&gt;('Date'[Jour]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; Dates = &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;('Date','Date'[Jour]&amp;lt;MaxDatePrevYear)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Var&lt;/SPAN&gt;&lt;SPAN&gt; Salespreviousyear = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;([Total incl VAT],&lt;/SPAN&gt;&lt;SPAN&gt;SAMEPERIODLASTYEAR&lt;/SPAN&gt;&lt;SPAN&gt;('Date'[Jour]))&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;(Salespreviousyear,Dates)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Raphaël&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 Mar 2023 14:06:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3121692#M110729</guid>
      <dc:creator>Raph</dc:creator>
      <dc:date>2023-03-09T14:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Actual previous year until the last sales day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3121915#M110748</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="107078" data-lia-user-login="Raph" class="lia-mention lia-mention-user"&gt;Raph&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would you please explain again what exactly the value are you exyto see for each date?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 15:23:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3121915#M110748</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-09T15:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Actual previous year until the last sales day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3121942#M110753</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know why&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;('Date'[Date]),&lt;/SPAN&gt;&lt;SPAN&gt;LASTNONBLANK&lt;/SPAN&gt;&lt;SPAN&gt;('Sales'[Date],[Sales]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;returns the last day of the year of 2023 and not last day of sales ? It's like the filter is without any effect.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Raphaël&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 Mar 2023 15:32:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3121942#M110753</guid>
      <dc:creator>Raph</dc:creator>
      <dc:date>2023-03-09T15:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Actual previous year until the last sales day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3121988#M110757</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;for each day of the month (1,2,3...) I would like to have the sales of the year and the sales of the previous year.&amp;nbsp; This works simply with the measure&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Actual previous year = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;([Total Sales],&lt;/SPAN&gt;&lt;SPAN&gt;SAMEPERIODLASTYEAR&lt;/SPAN&gt;&lt;SPAN&gt;('Date'[Day]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;... but this returns all the values of the month Y-1, and I would like to display the values only until the last day of sales of the current year. &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 Mar 2023 16:02:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3121988#M110757</guid>
      <dc:creator>Raph</dc:creator>
      <dc:date>2023-03-09T16:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Actual previous year until the last sales day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3122003#M110759</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&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>Thu, 09 Mar 2023 16:07:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3122003#M110759</guid>
      <dc:creator>Raph</dc:creator>
      <dc:date>2023-03-09T16:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Actual previous year until the last sales day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3123110#M110853</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="107078" data-lia-user-login="Raph" class="lia-mention lia-mention-user"&gt;Raph&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please try&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Actual previous year =
IF (
    MAX ( 'Date'[Date] ) &amp;lt;= CALCULATE ( MAX ( 'Sales'[Date] ), ALL ( 'Date' ) ),
    CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Day] ) )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Mar 2023 05:17:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3123110#M110853</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-10T05:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Actual previous year until the last sales day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3123308#M110863</link>
      <description>&lt;P&gt;Thank you very much,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;, this is indeed working well except that I lost the sum for the current month (sum is normally displayed if we filter on a a previous month)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 07:52:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3123308#M110863</guid>
      <dc:creator>Raph</dc:creator>
      <dc:date>2023-03-10T07:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Actual previous year until the last sales day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3123357#M110869</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="107078" data-lia-user-login="Raph" class="lia-mention lia-mention-user"&gt;Raph&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you mean total?&lt;/P&gt;
&lt;P&gt;Actual previous year =&lt;BR /&gt;SUMX (&lt;BR /&gt;VALUES ( 'Date'[Day-Month] ),&lt;BR /&gt;IF (&lt;BR /&gt;CALCULATE ( MAX ( 'Date'[Date] ) )&lt;BR /&gt;&amp;lt;= CALCULATE ( MAX ( 'Sales'[Date] ), ALL ( 'Date' ) ),&lt;BR /&gt;CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Day] ) )&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 08:18:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3123357#M110869</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-10T08:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Actual previous year until the last sales day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3123544#M110880</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, yes I meant the Total... I tried with SUMX (first on my own, iterating the days of Date table and then with your suggestion) but the visual won't change...&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 09:37:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3123544#M110880</guid>
      <dc:creator>Raph</dc:creator>
      <dc:date>2023-03-10T09:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Actual previous year until the last sales day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3123621#M110884</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="107078" data-lia-user-login="Raph" class="lia-mention lia-mention-user"&gt;Raph&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Have you wrapped MAX ( 'Date'[Date] ) with CALCULATE?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 12:07:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3123621#M110884</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-10T12:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Actual previous year until the last sales day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3123718#M110888</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, now it's working!&lt;/P&gt;&lt;P&gt;Thank you very much for your support!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Raphaël&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 10:32:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Actual-previous-year-until-the-last-sales-day/m-p/3123718#M110888</guid>
      <dc:creator>Raph</dc:creator>
      <dc:date>2023-03-10T10:32:11Z</dc:date>
    </item>
  </channel>
</rss>

