<?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: Rolling YTD for previous year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-YTD-for-previous-year/m-p/4293247#M170378</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270007" data-lia-user-login="cosmicyes" class="lia-mention lia-mention-user"&gt;cosmicyes&lt;/a&gt;&amp;nbsp;I think this will work&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Umsatz YTD Vorjahr = 
CALCULATE(
    [Umsatz],
    DATESBETWEEN(
        Kalender[Datum],
        DATE(YEAR(MAX(Kalender[Datum])) - 1, 1, 1), -- Start of the previous year
        DATE(YEAR(MAX(Kalender[Datum])) - 1, MONTH(MAX(Kalender[Datum])), DAY(MAX(Kalender[Datum]))) -- End date in the prior year
    )
)&lt;/LI-CODE&gt;&lt;P&gt;But if above formula is not filtering with changes in calendar.&amp;nbsp;&lt;BR /&gt;Try below code&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Umsatz YTD Vorjahr =
CALCULATE (
    [Umsatz],
    DATESYTD ( DATEADD ( Kalender[Datum], -1, YEAR ), "12/31" )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Nov 2024 11:45:56 GMT</pubDate>
    <dc:creator>saurabhtd</dc:creator>
    <dc:date>2024-11-20T11:45:56Z</dc:date>
    <item>
      <title>Rolling YTD for previous year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-YTD-for-previous-year/m-p/4293022#M170364</link>
      <description>&lt;P&gt;Dear Power BI friends,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to write a measure that gives me the YTD value of my revenue relative to the previous year. Today is November 20, 2024, and I have the revenue in the measure "Umsatz". What I want is the revenue for the period from January 1, 2023, to November 20, 2023.&lt;/P&gt;&lt;P&gt;The measure should roll dynamically, meaning it should respond to changes in the calendar slicers.&lt;/P&gt;&lt;P&gt;I have managed to get it working halfway, but this way, the measure does not respond to changes in the calendar:&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;LI-CODE lang="markup"&gt;Umsatz YTD Vorjahr # =
CALCULATE (
    CALCULATE (
        [Umsatz],
        DATESYTD ( Kalender[Datum] )
    ),
    Kalender[Datum]
        = (
            DATE ( YEAR ( TODAY () ) - 1, MONTH (
                TODAY ()
            ), DAY (
                TODAY ()
            ) )
        ) - 1
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 09:52:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-YTD-for-previous-year/m-p/4293022#M170364</guid>
      <dc:creator>cosmicyes</dc:creator>
      <dc:date>2024-11-20T09:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling YTD for previous year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-YTD-for-previous-year/m-p/4293140#M170371</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270007" data-lia-user-login="cosmicyes" class="lia-mention lia-mention-user"&gt;cosmicyes&lt;/a&gt;&amp;nbsp;, Try using&amp;nbsp;dax&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Umsatz YTD Vorjahr = &lt;BR /&gt;CALCULATE (&lt;BR /&gt;[Umsatz],&lt;BR /&gt;DATESYTD (&lt;BR /&gt;SAMEPERIODLASTYEAR ( Kalender[Datum] ),&lt;BR /&gt;"11/20"&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 10:49:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-YTD-for-previous-year/m-p/4293140#M170371</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2024-11-20T10:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling YTD for previous year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-YTD-for-previous-year/m-p/4293164#M170374</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;thank you very much - but 11/20 ist not flexible and rolling.&lt;BR /&gt;What I mean is: it should also work if I select June 2024 in calender and should show the result by June 23 2023 and so on...&lt;BR /&gt;Is this possible?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 10:58:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-YTD-for-previous-year/m-p/4293164#M170374</guid>
      <dc:creator>cosmicyes</dc:creator>
      <dc:date>2024-11-20T10:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling YTD for previous year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-YTD-for-previous-year/m-p/4293166#M170375</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270007" data-lia-user-login="cosmicyes" class="lia-mention lia-mention-user"&gt;cosmicyes&lt;/a&gt;&amp;nbsp;This DAX will give you result&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Umsatz YTD Vorjahr = 
CALCULATE(
    [Umsatz],
    SAMEPERIODLASTYEAR(
        DATESYTD(Kalender[Datum])
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 20 Nov 2024 10:59:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-YTD-for-previous-year/m-p/4293166#M170375</guid>
      <dc:creator>saurabhtd</dc:creator>
      <dc:date>2024-11-20T10:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling YTD for previous year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-YTD-for-previous-year/m-p/4293186#M170376</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;this looks really good and I hoped it worked.&lt;BR /&gt;But it seems the measure delivers the revenue for the *whole* year 2023.&lt;BR /&gt;Am I missing something?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 11:05:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-YTD-for-previous-year/m-p/4293186#M170376</guid>
      <dc:creator>cosmicyes</dc:creator>
      <dc:date>2024-11-20T11:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling YTD for previous year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-YTD-for-previous-year/m-p/4293247#M170378</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="270007" data-lia-user-login="cosmicyes" class="lia-mention lia-mention-user"&gt;cosmicyes&lt;/a&gt;&amp;nbsp;I think this will work&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Umsatz YTD Vorjahr = 
CALCULATE(
    [Umsatz],
    DATESBETWEEN(
        Kalender[Datum],
        DATE(YEAR(MAX(Kalender[Datum])) - 1, 1, 1), -- Start of the previous year
        DATE(YEAR(MAX(Kalender[Datum])) - 1, MONTH(MAX(Kalender[Datum])), DAY(MAX(Kalender[Datum]))) -- End date in the prior year
    )
)&lt;/LI-CODE&gt;&lt;P&gt;But if above formula is not filtering with changes in calendar.&amp;nbsp;&lt;BR /&gt;Try below code&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Umsatz YTD Vorjahr =
CALCULATE (
    [Umsatz],
    DATESYTD ( DATEADD ( Kalender[Datum], -1, YEAR ), "12/31" )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 11:45:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-YTD-for-previous-year/m-p/4293247#M170378</guid>
      <dc:creator>saurabhtd</dc:creator>
      <dc:date>2024-11-20T11:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling YTD for previous year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-YTD-for-previous-year/m-p/4293302#M170384</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Thank you very much.&lt;BR /&gt;It still does not work 100% but this is something I can work with!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 12:13:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-YTD-for-previous-year/m-p/4293302#M170384</guid>
      <dc:creator>cosmicyes</dc:creator>
      <dc:date>2024-11-20T12:13:09Z</dc:date>
    </item>
  </channel>
</rss>

