<?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 SAMEPERIODLASTYEAR NOT WORKING in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-NOT-WORKING/m-p/2707150#M82123</link>
    <description>&lt;P&gt;Hi.&lt;BR /&gt;&lt;BR /&gt;I have created a calculated measure using the function SAMEPERIODLASTYEAR but somehow I got the "contiguos date selection" error and I don't know how to fix this.&lt;BR /&gt;&lt;BR /&gt;Thank you for your help.&lt;BR /&gt;&lt;BR /&gt;Daniel Kataoka.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Aug 2022 14:58:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-08-17T14:58:56Z</dc:date>
    <item>
      <title>SAMEPERIODLASTYEAR NOT WORKING</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-NOT-WORKING/m-p/2707150#M82123</link>
      <description>&lt;P&gt;Hi.&lt;BR /&gt;&lt;BR /&gt;I have created a calculated measure using the function SAMEPERIODLASTYEAR but somehow I got the "contiguos date selection" error and I don't know how to fix this.&lt;BR /&gt;&lt;BR /&gt;Thank you for your help.&lt;BR /&gt;&lt;BR /&gt;Daniel Kataoka.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 14:58:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-NOT-WORKING/m-p/2707150#M82123</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-17T14:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAMEPERIODLASTYEAR NOT WORKING</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-NOT-WORKING/m-p/2707332#M82135</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , You should always use a date table, joined with your table on a date having a single directional join. &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;FONT size="2"&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;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;radacad&lt;/A&gt; &lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank"&gt;sqlbi&lt;/A&gt; &lt;A href="https://www.youtube.com/playlist?list=PLPaNVDMhUXGYLz-w8ERQOo3KYARs7GgG-" target="_blank"&gt;My Video Series&lt;/A&gt; Appreciate your Kudos. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 16:00:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-NOT-WORKING/m-p/2707332#M82135</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-08-17T16:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAMEPERIODLASTYEAR NOT WORKING</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-NOT-WORKING/m-p/2707414#M82144</link>
      <description>&lt;P&gt;Hi, &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;.&lt;BR /&gt;&lt;BR /&gt;Tks for your answer.&lt;BR /&gt;I already have a date table joined with my fact/s but I also created another table called SpecialDates where I joined with the column date from the date table.&lt;BR /&gt;&lt;BR /&gt;The SpecialDates table is a table with custom dates: all months (jan, feb, mar, apr..) and anothers custom dates (Last Month, 1 Semester, 2 Semester, YTD, Full Year..)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 16:32:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-NOT-WORKING/m-p/2707414#M82144</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-17T16:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: SAMEPERIODLASTYEAR NOT WORKING</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-NOT-WORKING/m-p/2737188#M83962</link>
      <description>&lt;P&gt;Hi，&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/dax/sameperiodlastyear-function-dax" target="_blank" rel="noopener"&gt;SAMEPERIODLASTYEAR&lt;/A&gt;&amp;nbsp; is a time-intelligent function,&amp;nbsp;so it is recommended to perform this function on a calendar table containing consecutive dates.&lt;/P&gt;
&lt;P&gt;Make sure you use&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt; CALCULATE([Measure], SAMEPERIODLASTYEAR(Calendar[Date]))&lt;/LI-CODE&gt;
&lt;P&gt;rather than&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt; CALCULATE([Measure], SAMEPERIODLASTYEAR(Facttable[Date]))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also try using filter and &lt;A href="https://docs.microsoft.com/en-us/dax/dateadd-function-dax" target="_blank" rel="noopener"&gt;DATEADD&lt;/A&gt;&amp;nbsp;. The dates returned by&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/dax/sameperiodlastyear-function-dax" target="_blank" rel="noopener"&gt;SAMEPERIODLASTYEAR&lt;/A&gt;&amp;nbsp; are the same as the dates returned by this equivalent formula:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;DATEADD(dates, -1, year)&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other related threads:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Function-SAMEPERIODLASTYEAR-expects-a-contiguous-selection-Issue/td-p/583072/page/2" target="_blank" rel="noopener"&gt;Function 'SAMEPERIODLASTYEAR' expects a contiguous selection Issue&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Contiguous-date-selection-error-YTD-LY/m-p/55789" target="_blank" rel="noopener"&gt;Contiguous date selection error - YTD LY&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/40784544/sameperiodlastyear-only-works-with-contiguous-date-selection" target="_blank" rel="noopener"&gt;sameperiodlastyear only works with contiguous date selection&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Eason&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2022 07:04:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-NOT-WORKING/m-p/2737188#M83962</guid>
      <dc:creator>v-easonf-msft</dc:creator>
      <dc:date>2022-08-31T07:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: SAMEPERIODLASTYEAR NOT WORKING</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-NOT-WORKING/m-p/4804710#M183787</link>
      <description>&lt;P&gt;Adding this solution in case others had the same experience as me.&amp;nbsp; I was getting the 'Function 'SAMEPERIODLASTYEAR' only works with contiguous date selections' error message on a file that had updated monthly for the past year without issue.&amp;nbsp; The error appeared after refreshing the data with a dataflow.&amp;nbsp; During fault finding I tested refreshing the file on a colleague's laptop and it worked fine so I knew I had an issue with my laptop rather than the file itself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The solution on my laptop was a simple clearing of the Excel cache.&amp;nbsp; As soon as the Excel cache was clear, the file refreshed without the error message coming back and everything worked fine again.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Aug 2025 08:52:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-NOT-WORKING/m-p/4804710#M183787</guid>
      <dc:creator>Ed_T</dc:creator>
      <dc:date>2025-08-22T08:52:04Z</dc:date>
    </item>
  </channel>
</rss>

