<?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 YTD Year over Year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-Year-over-Year/m-p/1048279#M14251</link>
    <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I an facing some issue in Dax.&lt;/P&gt;&lt;P&gt;I want to calculate Year over Year Change for YTD. Like for Feb'20 i have data till feb so I want in YOY change it should select data for 2019 till feb only.&lt;/P&gt;&lt;P&gt;But somehow it is taking taking Full year 2019 data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you pls help me out here.&lt;/P&gt;</description>
    <pubDate>Sat, 25 Apr 2020 13:40:18 GMT</pubDate>
    <dc:creator>SK16</dc:creator>
    <dc:date>2020-04-25T13:40:18Z</dc:date>
    <item>
      <title>YTD Year over Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-Year-over-Year/m-p/1048279#M14251</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I an facing some issue in Dax.&lt;/P&gt;&lt;P&gt;I want to calculate Year over Year Change for YTD. Like for Feb'20 i have data till feb so I want in YOY change it should select data for 2019 till feb only.&lt;/P&gt;&lt;P&gt;But somehow it is taking taking Full year 2019 data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you pls help me out here.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Apr 2020 13:40:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-Year-over-Year/m-p/1048279#M14251</guid>
      <dc:creator>SK16</dc:creator>
      <dc:date>2020-04-25T13:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Year over Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-Year-over-Year/m-p/1048285#M14252</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="140261" data-lia-user-login="SK16" class="lia-mention lia-mention-user"&gt;SK16&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will work with date calendar.&lt;/P&gt;
&lt;P&gt;If you have slicer to pass dates&lt;/P&gt;
&lt;P&gt;YTD QTY = TOTALYTD(Sum('order'[Qty]),'Date'[Date])&lt;BR /&gt;LYTD QTY = TOTALYTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using Today&lt;/P&gt;
&lt;P&gt;YTD QTY forced= &lt;BR /&gt;var _max = today()&lt;BR /&gt;return&lt;BR /&gt;calculate(Sum('order'[Qty]),DATESYTD('Date'[Date]),'Date'[Date]&amp;lt;=_max)&lt;BR /&gt;//calculate(TOTALYTD(Sum('order'[Qty]),'Date'[Date]),filter('Date','Date'[Date]&amp;lt;=_max))&lt;/P&gt;
&lt;P&gt;LYTD QTY forced= &lt;BR /&gt;var _max = date(year(today())-1,month(today()),day(today()))&lt;BR /&gt;return&lt;BR /&gt;CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date'[Date],-1,year)),'Date'[Date]&amp;lt;=_max)&lt;BR /&gt;//TOTALYTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year),'Date'[Date]&amp;lt;=_max)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using Max date&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;YTD QTY forced= &lt;BR /&gt;var _max = maxx('order',[Order date])&lt;BR /&gt;return&lt;BR /&gt;calculate(Sum('order'[Qty]),DATESYTD('Date'[Date]),'Date'[Date]&amp;lt;=_max)&lt;BR /&gt;//calculate(TOTALYTD(Sum('order'[Qty]),'Date'[Date]),filter('Date','Date'[Date]&amp;lt;=_max))&lt;/P&gt;
&lt;P&gt;LYTD QTY forced= &lt;BR /&gt;var _max1 =maxx('order',[Order date])&lt;BR /&gt;var _max = date(year(_max1)-1,month(_max1),day(_max1))&lt;BR /&gt;return&lt;BR /&gt;CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date'[Date],-1,year)),'Date'[Date]&amp;lt;=_max)&lt;BR /&gt;//TOTALYTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year),'Date'[Date]&amp;lt;=_max)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&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;BR /&gt;&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions&lt;/A&gt; &lt;BR /&gt;&lt;A href="https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi" target="_blank"&gt;https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/&lt;/A&gt;&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;I am hosting a webinar on 25th April on Power BI, Check Details - &lt;A href="https://www.linkedin.com/posts/amitchandak78_webinar-tech-techforgood-activity-6658266754378231808-ye5L" target="_blank"&gt;https://www.linkedin.com/posts/amitchandak78_webinar-tech-techforgood-activity-6658266754378231808-ye5L&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Apr 2020 13:50:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-Year-over-Year/m-p/1048285#M14252</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-04-25T13:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Year over Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-Year-over-Year/m-p/1048286#M14253</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="140261" data-lia-user-login="SK16" class="lia-mention lia-mention-user"&gt;SK16&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can add an If condition to check if the fact table "sales" in my case is empty.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sales YTD = 
IF( 
    NOT ISEMPTY( Sales ), 
    CALCULATE(
        [Sales],
        DATESYTD( 'Calendar'[Date] )
    )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Sales YTD LY = 
CALCULATE(
    [Sales YTD],
    SAMEPERIODLASTYEAR( 'Calendar'[Date] )
)&lt;/LI-CODE&gt;
&lt;DIV&gt;Best Regards,&lt;BR /&gt;Mariusz&lt;BR /&gt;&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accepting it as the solution&lt;/I&gt;&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;Please feel free to connect with me.&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/mariusz-repczynski-065a7362/" target="_blank"&gt; LinkedIn &lt;/A&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Apr 2020 13:51:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-Year-over-Year/m-p/1048286#M14253</guid>
      <dc:creator>Mariusz</dc:creator>
      <dc:date>2020-04-25T13:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Year over Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-Year-over-Year/m-p/1048661#M14278</link>
      <description>&lt;P&gt;Hi Mariusz,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help buddy.&lt;/P&gt;&lt;P&gt;I got the issue which I am facing in my Dax i.e if if dont select any Month then it is taking Full Previous Year but if I any select months from the slicer then it is showing the correct value.&lt;/P&gt;&lt;P&gt;But I want without selecting any month i should consider lates month for YTD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Apr 2020 22:24:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-Year-over-Year/m-p/1048661#M14278</guid>
      <dc:creator>SK16</dc:creator>
      <dc:date>2020-04-25T22:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Year over Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-Year-over-Year/m-p/1048662#M14279</link>
      <description>&lt;P&gt;Hi Mariusz,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help buddy.&lt;/P&gt;&lt;P&gt;I got the issue which I am facing in my Dax i.e if I dont select any Month then it is taking Full Previous Year but if&amp;nbsp; select months from the slicer then it is showing the correct value.&lt;/P&gt;&lt;P&gt;But what I want is that without selecting any month it should consider latest month for YTD.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Apr 2020 22:26:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-Year-over-Year/m-p/1048662#M14279</guid>
      <dc:creator>SK16</dc:creator>
      <dc:date>2020-04-25T22:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Year over Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-Year-over-Year/m-p/1048786#M14288</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="140261" data-lia-user-login="SK16" class="lia-mention lia-mention-user"&gt;SK16&lt;/a&gt; , check the way I suggested to force either Today or max date as a filter in YTD.&lt;/P&gt;
&lt;P&gt;You have to force additional date filter on top of YTD&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2020 06:13:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-Year-over-Year/m-p/1048786#M14288</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-04-26T06:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Year over Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-Year-over-Year/m-p/1058650#M14642</link>
      <description>&lt;P&gt;Thanks Amit,&lt;/P&gt;&lt;P&gt;It really helped&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 08:40:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-Year-over-Year/m-p/1058650#M14642</guid>
      <dc:creator>SK16</dc:creator>
      <dc:date>2020-04-30T08:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: YTD Year over Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-Year-over-Year/m-p/1058663#M14643</link>
      <description>&lt;P&gt;I am facing same issue for Month to date.&lt;/P&gt;&lt;P&gt;Can you please help me out here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 08:46:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-Year-over-Year/m-p/1058663#M14643</guid>
      <dc:creator>SK16</dc:creator>
      <dc:date>2020-04-30T08:46:21Z</dc:date>
    </item>
  </channel>
</rss>

