<?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: Same period from a Specific Year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-period-from-a-Specific-Year/m-p/2268741#M55132</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="178705" data-lia-user-login="liboyjoseph" class="lia-mention lia-mention-user"&gt;liboyjoseph&lt;/a&gt; , Please create Year a column in date table. Do not use.Year . TI does not work well with that &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :&lt;A href="https://youtu.be/OBf0rjpp5Hw" target="_blank"&gt;https://youtu.be/OBf0rjpp5Hw&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4" target="_blank"&gt;https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;You can also try&lt;/P&gt;
&lt;P&gt;Y3 =&lt;/P&gt;
&lt;P&gt;var _diff = 2019 - maxx(allselected('Date'), 'Date'[Year]) )&lt;/P&gt;
&lt;P&gt;//or var _diff = 2019 - year(maxx(allselected('Date'), 'Date'[date]) ))&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;CALCULATE([Total Sales TY],DATEADD('Date'[Date], _diff , YEAR))&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jan 2022 06:05:56 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2022-01-06T06:05:56Z</dc:date>
    <item>
      <title>Same period from a Specific Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-period-from-a-Specific-Year/m-p/2265158#M54843</link>
      <description>&lt;P&gt;Hi Guys,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need your hand on this,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a measure for TY, LY, also 2 Years Ago which is 2019 (When current date selection is on 2021)&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Y2 = CALCULATE([Total Sales TY],DATEADD('Date'[Date], -2, YEAR)) This was working perfectly till dec-31- 2021&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Now when I change current date to 2022, it will pick up a period from Year of 2020 which is two year ago, is there any way to change this measure to pick the date range always from 2019 without creating a new one? The idea is to bring the value from same date range but always the year should be 2019&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Need your help on this please.!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 04 Jan 2022 09:26:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-period-from-a-Specific-Year/m-p/2265158#M54843</guid>
      <dc:creator>liboyjoseph</dc:creator>
      <dc:date>2022-01-04T09:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Same period from a Specific Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-period-from-a-Specific-Year/m-p/2265169#M54845</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="178705" data-lia-user-login="liboyjoseph" class="lia-mention lia-mention-user"&gt;liboyjoseph&lt;/a&gt; , Based on what I got &lt;/P&gt;
&lt;P&gt;Try like&lt;/P&gt;
&lt;P&gt;YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))&lt;/P&gt;
&lt;P&gt;Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))&lt;/P&gt;
&lt;P&gt;2nd Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or try like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LYTD QTY forced=&lt;BR /&gt;var _today = maxx(allselected('Order'),'order'[Date]) // or //Today &lt;BR /&gt;var _max = date(year(_today)-1,month(_today),day(_today))&lt;BR /&gt;return&lt;BR /&gt;if(max('Date'[Date])&amp;lt;=_max, CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date'[Date],-1,year)),'Date'[Date]&amp;lt;=_max), blank())&lt;BR /&gt;//OR&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;2nd LYTD QTY forced=&lt;BR /&gt;var _today = maxx(allselected('Order'),'order'[Date]) // or //Today &lt;BR /&gt;var _max = date(year(_today)-2,month(_today),day(_today))&lt;BR /&gt;return&lt;BR /&gt;if(max('Date'[Date])&amp;lt;=_max, CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date'[Date],-2,year)),'Date'[Date]&amp;lt;=_max), blank())&lt;BR /&gt;//OR&lt;BR /&gt;//CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date'[Date],-2,year)),'Date'[Date]&amp;lt;=_max)&lt;BR /&gt;//TOTALYTD(Sum('order'[Qty]),dateadd('Date'[Date],-2,year),'Date'[Date]&amp;lt;=_max)&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 09:31:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-period-from-a-Specific-Year/m-p/2265169#M54845</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-01-04T09:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Same period from a Specific Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-period-from-a-Specific-Year/m-p/2265191#M54846</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;Thank you so much &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;, Let me try this and will get back to you&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 04 Jan 2022 09:46:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-period-from-a-Specific-Year/m-p/2265191#M54846</guid>
      <dc:creator>liboyjoseph</dc:creator>
      <dc:date>2022-01-04T09:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Same period from a Specific Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-period-from-a-Specific-Year/m-p/2265413#M54860</link>
      <description>&lt;P&gt;I've tried all this, but no luck. I think my statment was not clear or you did not get my point. Let me explain&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its similar to sameperiod last year, instad of last year, I need 2019.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 11:43:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-period-from-a-Specific-Year/m-p/2265413#M54860</guid>
      <dc:creator>liboyjoseph</dc:creator>
      <dc:date>2022-01-04T11:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Same period from a Specific Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-period-from-a-Specific-Year/m-p/2265594#M54881</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="178705" data-lia-user-login="liboyjoseph" class="lia-mention lia-mention-user"&gt;liboyjoseph&lt;/a&gt; , Then you can fix it like &lt;/P&gt;
&lt;P&gt;2019 Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'[year]),'Date'[year] =2019))&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 13:53:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-period-from-a-Specific-Year/m-p/2265594#M54881</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-01-04T13:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Same period from a Specific Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-period-from-a-Specific-Year/m-p/2266047#M54917</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&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; but it doesn't work for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 18:45:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-period-from-a-Specific-Year/m-p/2266047#M54917</guid>
      <dc:creator>liboyjoseph</dc:creator>
      <dc:date>2022-01-04T18:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Same period from a Specific Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-period-from-a-Specific-Year/m-p/2268741#M55132</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="178705" data-lia-user-login="liboyjoseph" class="lia-mention lia-mention-user"&gt;liboyjoseph&lt;/a&gt; , Please create Year a column in date table. Do not use.Year . TI does not work well with that &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :&lt;A href="https://youtu.be/OBf0rjpp5Hw" target="_blank"&gt;https://youtu.be/OBf0rjpp5Hw&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4" target="_blank"&gt;https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;You can also try&lt;/P&gt;
&lt;P&gt;Y3 =&lt;/P&gt;
&lt;P&gt;var _diff = 2019 - maxx(allselected('Date'), 'Date'[Year]) )&lt;/P&gt;
&lt;P&gt;//or var _diff = 2019 - year(maxx(allselected('Date'), 'Date'[date]) ))&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;CALCULATE([Total Sales TY],DATEADD('Date'[Date], _diff , YEAR))&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 06:05:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-period-from-a-Specific-Year/m-p/2268741#M55132</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-01-06T06:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Same period from a Specific Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-period-from-a-Specific-Year/m-p/2300727#M56819</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="178705" data-lia-user-login="liboyjoseph" class="lia-mention lia-mention-user"&gt;liboyjoseph&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you solved this question with amitchandak's&amp;nbsp;help? If you have solved the question,&amp;nbsp;&lt;U&gt;you can accept the answer helpful as the solution&lt;/U&gt;&amp;nbsp;&lt;STRONG&gt;or&lt;/STRONG&gt;&amp;nbsp;&lt;U&gt;share you method and accept it as solution&lt;/U&gt;, thanks for your contribution to improve Power BI.&lt;/P&gt;
&lt;P&gt;If you need more help, please let me know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Tang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 10:13:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-period-from-a-Specific-Year/m-p/2300727#M56819</guid>
      <dc:creator>v-xiaotang</dc:creator>
      <dc:date>2022-01-25T10:13:34Z</dc:date>
    </item>
  </channel>
</rss>

