<?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 all category values are showing in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-not-all-category-values-are-showing/m-p/1205965#M19366</link>
    <description>Time-intel functions work correctly ONLY on proper date tables. Just create a correct star-schema model.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
    <pubDate>Tue, 07 Jul 2020 09:19:18 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-07-07T09:19:18Z</dc:date>
    <item>
      <title>SAMEPERIODLASTYEAR not all category values are showing</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-not-all-category-values-are-showing/m-p/1204658#M19352</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been searching but can't seem to find the right answer, so looking for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the following formula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SalesLastYear = CALCULATE( SUM(Sales_DailyReport[Net amount]),SAMEPERIODLASTYEAR(Sales_DailyReport[Invoice Date]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I'm working with different product caterogies. Now, if a product category hasn't been sold on a particalur day, the formula won't retrieve the value for that product catergory for the same day last year either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Sold on 6 May 2020:&lt;/TD&gt;&lt;TD&gt;Sold on 6 May 2019:&lt;/TD&gt;&lt;TD&gt;My (incorrect) result of formula, sold on 6 May 2019:&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Product 1: $700&lt;/TD&gt;&lt;TD&gt;Product 1: $500&lt;/TD&gt;&lt;TD&gt;Product 1: $500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Product 2: $200&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Product 3: $50&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I need to see the total of $550, but the formula doesn't 'see' product 3 as it was not sold on 6 May 2020.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried multiple variations of DAX, including ALL , VALUES (to include the product categories) and DATEADD, .[date], PARALLELPERIOD (to try different ways), all without success.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts please?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 20:27:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-not-all-category-values-are-showing/m-p/1204658#M19352</guid>
      <dc:creator>SvG</dc:creator>
      <dc:date>2020-07-06T20:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAMEPERIODLASTYEAR not all category values are showing</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-not-all-category-values-are-showing/m-p/1204712#M19354</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="243957" data-lia-user-login="SvG" class="lia-mention lia-mention-user"&gt;SvG&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the issue here comes down to the DAX auto-exists concept. You should build a proper date table to do your time-intelligence on. You see, the auto-exist concept allows DAX to be efficient and since product 3 doesn't exist in the original context my take on it is that it is "lost" due to the auto-exist optimisation of the DAX language, even when SAMEPERIODLASTYEAR shifts the context.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try adding a date table and using SAMEPERIODLASTYEAR on this instead. Also refer to this article.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/understanding-dax-auto-exist/" target="_blank" rel="noopener"&gt;https://www.sqlbi.com/articles/understanding-dax-auto-exist/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kris&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2020 21:13:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-not-all-category-values-are-showing/m-p/1204712#M19354</guid>
      <dc:creator>kriscoupe</dc:creator>
      <dc:date>2020-07-06T21:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAMEPERIODLASTYEAR not all category values are showing</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-not-all-category-values-are-showing/m-p/1205965#M19366</link>
      <description>Time-intel functions work correctly ONLY on proper date tables. Just create a correct star-schema model.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Tue, 07 Jul 2020 09:19:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-not-all-category-values-are-showing/m-p/1205965#M19366</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-07T09:19:18Z</dc:date>
    </item>
  </channel>
</rss>

