<?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 not working on previous year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-not-working-on-previous-year/m-p/2730962#M83643</link>
    <description>&lt;P&gt;Hi, I've done it but now but unfortunately it shows no results. Here's a screenshot:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 28 Aug 2022 18:39:32 GMT</pubDate>
    <dc:creator>MarcoT</dc:creator>
    <dc:date>2022-08-28T18:39:32Z</dc:date>
    <item>
      <title>SAMEPERIODLASTYEAR not working on previous year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-not-working-on-previous-year/m-p/2730920#M83639</link>
      <description>&lt;P&gt;Hi, I'm pretty new to PowerBI and I appreciate this forum to share experiences.&lt;/P&gt;&lt;P&gt;I've a problem with a measure not displaying the correct value. I've a fact table called Summary in which I've the field [Prepared Quantity] on wich I've created this measure:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Deliberated Lines TOT = CALCULATE(SUM('Summary'[Prepared Quantity]), GROUPBY('Summary','Summary'[Planned Delivery Date],'Summary'[Shipment Type],'Summary'[FLG Prep]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where&amp;nbsp;[Planned Delivery Date] is a non-unique field of type date.&lt;/P&gt;&lt;P&gt;What I would like to do is displaying the same value but one year before the selected date or the date in the visual row. I tried to use the SAMEPERIODLASTYEAR with&amp;nbsp;[Planned Delivery Date] but it gave me an error because the date rows are not unique. So I added a calendar table in order to do that and I linked the&amp;nbsp;[Planned Delivery Date Id] field to the calendar key of the calendar dimension. After that I've created this measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Deliberated Lines TOT Previous Year = CALCULATE('Summary'[Deliberated Lines TOT],ALL('Calendar'[Date Value]),SAMEPERIODLASTYEAR('Calendar'[Date Value]))&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it shows me the same value of the [Deliberated Lines TOT] measure.&lt;/P&gt;&lt;P&gt;Here's a screenshot:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;What I'm doing wrong?&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Aug 2022 16:49:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-not-working-on-previous-year/m-p/2730920#M83639</guid>
      <dc:creator>MarcoT</dc:creator>
      <dc:date>2022-08-28T16:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAMEPERIODLASTYEAR not working on previous year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-not-working-on-previous-year/m-p/2730948#M83642</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="381789" data-lia-user-login="MarcoT" class="lia-mention lia-mention-user"&gt;MarcoT&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your table visual, Instead of Planned Delivery Date please use 'Calendar'[Date] and instead of Week&amp;nbsp;&lt;SPAN&gt;Planned Delivery Date use 'Calender'[Week Number]&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Aug 2022 18:01:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-not-working-on-previous-year/m-p/2730948#M83642</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-08-28T18:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAMEPERIODLASTYEAR not working on previous year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-not-working-on-previous-year/m-p/2730962#M83643</link>
      <description>&lt;P&gt;Hi, I've done it but now but unfortunately it shows no results. Here's a screenshot:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Aug 2022 18:39:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-not-working-on-previous-year/m-p/2730962#M83643</guid>
      <dc:creator>MarcoT</dc:creator>
      <dc:date>2022-08-28T18:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAMEPERIODLASTYEAR not working on previous year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-not-working-on-previous-year/m-p/2730971#M83644</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="381789" data-lia-user-login="MarcoT" class="lia-mention lia-mention-user"&gt;MarcoT&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Week in Year Number make sure tgat you select "Do not summarize" also make sure that 'Calendar' is marked as date table with Date Value as the date column. Then the following should technically work.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Deliberated Lines TOT Previous Year =
CALCULATE (
    'Summary'[Deliberated Lines TOT],
    ALL ( 'Calendar' ),
    SAMEPERIODLASTYEAR ( 'Calendar'[Date Value] )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 28 Aug 2022 19:16:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-not-working-on-previous-year/m-p/2730971#M83644</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-08-28T19:16:46Z</dc:date>
    </item>
  </channel>
</rss>

