<?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: SAMEPERIODLASTYEAR and DATEADD return BLANK value from last year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-and-DATEADD-return-BLANK-value-from-last-year/m-p/3477547#M132891</link>
    <description>&lt;P&gt;Hi&lt;BR /&gt;&lt;BR /&gt;Sorry for the first answer, I misunderstood your question and now I noticed you want a &lt;STRONG&gt;Calculated Column&lt;/STRONG&gt;, instead of a Measure.&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;SPAN class=""&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;SUM&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;Table1[Units]&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;ALL&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;Table1&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;SAMEPERIODLASTYEAR&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;Table1[Date]&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 15 Oct 2023 22:42:51 GMT</pubDate>
    <dc:creator>jmlesteves</dc:creator>
    <dc:date>2023-10-15T22:42:51Z</dc:date>
    <item>
      <title>SAMEPERIODLASTYEAR and DATEADD return BLANK value from last year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-and-DATEADD-return-BLANK-value-from-last-year/m-p/3477474#M132884</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm stuck and need help. I have a simple table with just Date and Units as shown below. I need to create a column to return value from the same month in previous year in Power Pivot Data Model. Unfortunately, I have tried the following DAX formula but all return as Blank value,&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;=CALCULATE(SUM([Units]), SAMEPERIODLASTYEAR(Table1[Date]))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;=CALCULATE(SUM([Units]), DATEADD(Table1[Date], -1, YEAR))&lt;/LI-CODE&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;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alternatively, I have tried using&amp;nbsp;&lt;!--  StartFragment   --&gt;&lt;SPAN class=""&gt;PREVIOUSYEAR. There are numbers showing but it's incorrect and I cant figure it out why either&lt;/SPAN&gt;&lt;!--  EndFragment   --&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=CALCULATE(SUM([Units]), PREVIOUSYEAR(Table1[Date]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&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;&lt;SPAN class=""&gt;Hope someone could enlighten me, thank you!!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Oct 2023 18:50:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-and-DATEADD-return-BLANK-value-from-last-year/m-p/3477474#M132884</guid>
      <dc:creator>M001</dc:creator>
      <dc:date>2023-10-15T18:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAMEPERIODLASTYEAR and DATEADD return BLANK value from last year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-and-DATEADD-return-BLANK-value-from-last-year/m-p/3477547#M132891</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;&lt;BR /&gt;Sorry for the first answer, I misunderstood your question and now I noticed you want a &lt;STRONG&gt;Calculated Column&lt;/STRONG&gt;, instead of a Measure.&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;SPAN class=""&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;SUM&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;Table1[Units]&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;ALL&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;Table1&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;SAMEPERIODLASTYEAR&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;Table1[Date]&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Oct 2023 22:42:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-and-DATEADD-return-BLANK-value-from-last-year/m-p/3477547#M132891</guid>
      <dc:creator>jmlesteves</dc:creator>
      <dc:date>2023-10-15T22:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAMEPERIODLASTYEAR and DATEADD return BLANK value from last year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-and-DATEADD-return-BLANK-value-from-last-year/m-p/3477625#M132897</link>
      <description>&lt;P&gt;Thank you, I just realize it's a filter seting issue, not exactly the same as your solution but your help has definitely enlightened me and I appreciate a lot&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 01:52:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-and-DATEADD-return-BLANK-value-from-last-year/m-p/3477625#M132897</guid>
      <dc:creator>M001</dc:creator>
      <dc:date>2023-10-16T01:52:18Z</dc:date>
    </item>
  </channel>
</rss>

