<?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: Sameperiod last year gives different results with different date tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiod-last-year-gives-different-results-with-different-date/m-p/1619247#M32665</link>
    <description>&lt;P&gt;That's not how SAMEPERIODLASTYEAR works. It will always use complete periods. If you want YoYTD logic you need to add that filter yourself.&lt;/P&gt;</description>
    <pubDate>Sun, 24 Jan 2021 23:58:42 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2021-01-24T23:58:42Z</dc:date>
    <item>
      <title>Sameperiod last year gives different results with different date tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiod-last-year-gives-different-results-with-different-date/m-p/1618010#M32636</link>
      <description>&lt;P&gt;&amp;nbsp;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have date range from Jan 1 2020 till Dec 31 2021.... when the date is 23/1/2021(today) I should see distinct count of 2021 (Jan1-jan23 2021) and compare to prev year(Jan1 2020- Jan 23 2021).... when the month slicer is feb, mar or any other month apart from Jan.. the YTD should be 0 because it does not have data after Jan 23 2021 but for prev year feb 2020 has data and pytd should show data. I am able to achieve this using different date tables and using same period last year.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to achieve this with the Activation Date field present in sheet1 data instead of creating a seperate date field, I am getting partial output but some of the cases, its throwing error due to dates discontinuity. I used MAX and min of the date and created a date table but that gives data from 2019 till date, I want to avoid 2019 data while selecting, I don't want to use visual level filters but instead in dax. in the max min table the date range of activation date should be from 1-jan-2020 till 31-dec-2021.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the pbix file below and the formula used,PYTD3 is giving me correct result which I want to achieve this using sheet1 activation date column and Maxmindatetable date column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;YTD = CALCULATE(DISTINCTCOUNT(Sheet1[ID]),DATESBETWEEN('CalendarDatetable'[Date],date(2021,01,01),date(2021,12,31)))&lt;/P&gt;&lt;P&gt;PYTD1 = CALCULATE(DISTINCTCOUNT(Sheet1[ID]),SAMEPERIODLASTYEAR('Maxmindatetable'[Date]))&lt;/P&gt;&lt;P&gt;PYTD2 = CALCULATE(DISTINCTCOUNT(Sheet1[ID]),SAMEPERIODLASTYEAR(Sheet1[Activation Date]))&lt;/P&gt;&lt;P&gt;PYTD3 = CALCULATE(DISTINCTCOUNT(Sheet1[ID]),SAMEPERIODLASTYEAR(CalendarDatetable[Date]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1I-VmtFK-XQU6-N1ijt8awAVzTUkxa5Er/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1I-VmtFK-XQU6-N1ijt8awAVzTUkxa5Er/view?usp=sharing&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2021 07:32:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiod-last-year-gives-different-results-with-different-date/m-p/1618010#M32636</guid>
      <dc:creator>anee123</dc:creator>
      <dc:date>2021-01-23T07:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Sameperiod last year gives different results with different date tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiod-last-year-gives-different-results-with-different-date/m-p/1619247#M32665</link>
      <description>&lt;P&gt;That's not how SAMEPERIODLASTYEAR works. It will always use complete periods. If you want YoYTD logic you need to add that filter yourself.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2021 23:58:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiod-last-year-gives-different-results-with-different-date/m-p/1619247#M32665</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-01-24T23:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sameperiod last year gives different results with different date tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiod-last-year-gives-different-results-with-different-date/m-p/1620015#M32687</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="266455" data-lia-user-login="anee123" class="lia-mention lia-mention-user"&gt;anee123&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You can refer to this&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Desktop/Calculating-Same-Period-Last-Year/m-p/1597997" target="_self"&gt;link&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 07:11:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sameperiod-last-year-gives-different-results-with-different-date/m-p/1620015#M32687</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-25T07:11:53Z</dc:date>
    </item>
  </channel>
</rss>

