<?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: Problem with SAMEPERIODLASTYEAR in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-SAMEPERIODLASTYEAR/m-p/947306#M10435</link>
    <description>&lt;P&gt;Thanks so much for your help!!&lt;/P&gt;&lt;P&gt;I had an issue regarding the format of my dimdate table&lt;/P&gt;</description>
    <pubDate>Tue, 25 Feb 2020 15:23:04 GMT</pubDate>
    <dc:creator>peluca</dc:creator>
    <dc:date>2020-02-25T15:23:04Z</dc:date>
    <item>
      <title>Problem with SAMEPERIODLASTYEAR</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-SAMEPERIODLASTYEAR/m-p/943564#M10144</link>
      <description>&lt;P&gt;After creating a dimdate table&amp;nbsp;I tried to calculate a measure by using SAMEPERIODLASTYEAR but it does not work.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;calculate(([Unid Actual]),SAMEPERIODLASTYEAR((DimDate[Date])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 21 Feb 2020 22:44:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-SAMEPERIODLASTYEAR/m-p/943564#M10144</guid>
      <dc:creator>peluca</dc:creator>
      <dc:date>2020-02-21T22:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SAMEPERIODLASTYEAR</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-SAMEPERIODLASTYEAR/m-p/943621#M10147</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="209591" data-lia-user-login="peluca" class="lia-mention lia-mention-user"&gt;peluca&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the structure of your data table? Also, I am hoping you have created the relationship between the date of your fact table and the calendar table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have recreated the scenario with a sample data:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And created a calendar table:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Calendar =
ADDCOLUMNS (
    CALENDAR ( MIN ( dtTable[Order Date] ), MAX ( dtTable[Order Date] ) ),
    "Year", YEAR ( [Date] ),
    "Month", DATE ( YEAR ( [Date] ), MONTH ( [Date] ), 1 )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And mark it as a date table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Created the relationship:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Created measures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Orders = SUM(dtTable[Order Quantity])

PY Orders =
CALCULATE ( [Total Orders], SAMEPERIODLASTYEAR ( 'Calendar'[Date] ) )

&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Getting the results in visual:&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;Regards,&lt;BR /&gt;Vivek&lt;BR /&gt;&lt;BR /&gt;If it helps, please mark it as a solution&lt;BR /&gt;&lt;BR /&gt;Kudos would be a cherry on the top &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.vivran.in/" target="_blank"&gt;https://www.vivran.in/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 02:47:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-SAMEPERIODLASTYEAR/m-p/943621#M10147</guid>
      <dc:creator>vivran22</dc:creator>
      <dc:date>2020-02-22T02:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SAMEPERIODLASTYEAR</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-SAMEPERIODLASTYEAR/m-p/943756#M10154</link>
      <description>It does work if you do it as it should be done. &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="141768" data-lia-user-login="vivran22" class="lia-mention lia-mention-user"&gt;vivran22&lt;/a&gt; has the right solution. For the time-intel functions to work correctly, you have to have a date table that has been marked in the model as DATE TABLE and connected to the facts/dims. Nothing more.</description>
      <pubDate>Sat, 22 Feb 2020 11:36:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-SAMEPERIODLASTYEAR/m-p/943756#M10154</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-22T11:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SAMEPERIODLASTYEAR</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-SAMEPERIODLASTYEAR/m-p/947306#M10435</link>
      <description>&lt;P&gt;Thanks so much for your help!!&lt;/P&gt;&lt;P&gt;I had an issue regarding the format of my dimdate table&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 15:23:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-SAMEPERIODLASTYEAR/m-p/947306#M10435</guid>
      <dc:creator>peluca</dc:creator>
      <dc:date>2020-02-25T15:23:04Z</dc:date>
    </item>
  </channel>
</rss>

