<?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: Calculate YTD and YTD-1 for the same period in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-and-YTD-1-for-the-same-period/m-p/2145439#M49367</link>
    <description>&lt;P&gt;Hi, I try your formula but it's not working, this formula returns me the whole previous year&lt;/P&gt;</description>
    <pubDate>Wed, 20 Oct 2021 11:11:45 GMT</pubDate>
    <dc:creator>AxelKAp</dc:creator>
    <dc:date>2021-10-20T11:11:45Z</dc:date>
    <item>
      <title>Calculate YTD and YTD-1 for the same period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-and-YTD-1-for-the-same-period/m-p/2143606#M49290</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to calculate the YTD Spend and the YTD -1 Spend for the same period.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For example for 2021 we are in October so I would like to calculate the Spend for 2020 only until October.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For the moment I have created this formula :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Spend YTD-1 = CALCULATE(SUM('Spend consolidé'[Invoice_Accounting_EUR]),SAMEPERIODLASTYEAR('Calendar'[Date]))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But it's not working, when I filter on 2021, with this formula I have the spend for the entire year of 2020 instead of having until October.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice to help me solve my problem ? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Axel&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 15:55:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-and-YTD-1-for-the-same-period/m-p/2143606#M49290</guid>
      <dc:creator>AxelKAp</dc:creator>
      <dc:date>2021-10-19T15:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate YTD and YTD-1 for the same period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-and-YTD-1-for-the-same-period/m-p/2143782#M49294</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="293005" data-lia-user-login="AxelKAp" class="lia-mention lia-mention-user"&gt;AxelKAp&lt;/a&gt;&amp;nbsp; can you try this for YTD calculation&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;YTDSumCY=
CALCULATE (
    SUM ( 'Spend consolidé'[Invoice_Accounting_EUR] ),
    'Calendar'[Calendar_Date] &amp;lt;= MAX ( 'Spend consolidé'[Date] ),
    ALL ( 'Calendar'[Calendar_Date] )
)

YTDSumPY = CALCULATE ([YTDSumCY], SAMEPERIODLASTYEAR('Calendar'[Calendar_Date]))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 17:50:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-and-YTD-1-for-the-same-period/m-p/2143782#M49294</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-10-19T17:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate YTD and YTD-1 for the same period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-and-YTD-1-for-the-same-period/m-p/2144372#M49321</link>
      <description>&lt;LI-CODE lang="markup"&gt;Spend LYTD =
CALCULATE(
    SUM( 'Spend consolidé'[Invoice_Accounting_EUR] ),
    DATEADD( DATESYTD( 'Calendar'[Date] ), -1, YEAR )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 20 Oct 2021 01:14:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-and-YTD-1-for-the-same-period/m-p/2144372#M49321</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2021-10-20T01:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate YTD and YTD-1 for the same period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-and-YTD-1-for-the-same-period/m-p/2145439#M49367</link>
      <description>&lt;P&gt;Hi, I try your formula but it's not working, this formula returns me the whole previous year&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 11:11:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-and-YTD-1-for-the-same-period/m-p/2145439#M49367</guid>
      <dc:creator>AxelKAp</dc:creator>
      <dc:date>2021-10-20T11:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate YTD and YTD-1 for the same period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-and-YTD-1-for-the-same-period/m-p/2145440#M49368</link>
      <description>&lt;P&gt;Hi, I have an error with ths formula, Power BI say me that I can't use MAX() with a TRUE/FALSE condition&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 11:13:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-and-YTD-1-for-the-same-period/m-p/2145440#M49368</guid>
      <dc:creator>AxelKAp</dc:creator>
      <dc:date>2021-10-20T11:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate YTD and YTD-1 for the same period</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-and-YTD-1-for-the-same-period/m-p/3209511#M117018</link>
      <description>&lt;P&gt;Finally this worked for me!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Spend YTD&lt;/STRONG&gt;&amp;nbsp;=&amp;nbsp;&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;'TableName'&lt;/SPAN&gt;&lt;SPAN&gt;[FieldName]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;DATESYTD&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'DateTableName'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Spend YTD-1 = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;STRONG&gt;Spend YTD&lt;/STRONG&gt;]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;SAMEPERIODLASTYEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DATESYTD&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;SPAN&gt;DateTableName'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I think the clue was filtering by DATESYTD.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 14:25:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-YTD-and-YTD-1-for-the-same-period/m-p/3209511#M117018</guid>
      <dc:creator>i26923</dc:creator>
      <dc:date>2023-04-27T14:25:09Z</dc:date>
    </item>
  </channel>
</rss>

