<?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: DATEADD With Inconsistent Date Range in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-With-Inconsistent-Date-Range/m-p/3941164#M153229</link>
    <description>&lt;P&gt;Hi-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see example at link below.&amp;nbsp; Essentially I am unable to get the PY measure to calculate properly.&amp;nbsp; If I use PARALLELPERIOD, it calculates however the amount is incorrect.&amp;nbsp; If I use DATEADD, it will not allow me to pull into the visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe the issue it due to the fact that Store 202 does not have data for Apr 2024.&amp;nbsp; However in my actual dataset, I want the ability to still be able to calculate PY in spite of this, and I want to have a separate slicer that will allow the user to toggle between comp, non comp, and all stores.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1BZrWk8RtIcTZBRL5JiDrnO8cVCYT4O9t/view?usp=drive_link" target="_blank"&gt;https://drive.google.com/file/d/1BZrWk8RtIcTZBRL5JiDrnO8cVCYT4O9t/view?usp=drive_link&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2024 02:24:47 GMT</pubDate>
    <dc:creator>dhenders1833</dc:creator>
    <dc:date>2024-05-23T02:24:47Z</dc:date>
    <item>
      <title>DATEADD With Inconsistent Date Range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-With-Inconsistent-Date-Range/m-p/3937526#M153127</link>
      <description>&lt;P&gt;Hi All-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have searched for days on YouTube and the web trying to find solve for the folllowing issue, and hope someone here can help.&amp;nbsp; I have the following dataset that includes sales by store for the last 3 years.&amp;nbsp; When I try to calcuate prior year sales using the DATEADD function, I receive the following error.&amp;nbsp; I believe it is due to the fact that the dataset includes new stores that do not have a prior year to reference.&amp;nbsp; Has anyone found a solution for how to get the DATEADD function to work in this case?&amp;nbsp; I have found a workaround by using the PARALLELPERIOD function when calcualting MTD, QTD, and YTD, however I want to include a custom date filter in my slicer, and need to utilize DATEADD so that it will calculate exactly 365 back from the specified date range.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My fact table: tbl_ReportData&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;My date table: tbl_Date&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created separate a custom sales measure (in addition to MTD, QTD, and YTD measures I have also created.&amp;nbsp; I have a disconnected table that I am using with the slicer):&lt;/P&gt;&lt;DIV&gt;&lt;H6&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;Custom Sales =&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/H6&gt;&lt;H6&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/H6&gt;&lt;H6&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;[Total Sales]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/H6&gt;&lt;H6&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/H6&gt;&lt;H6&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;tbl_Date&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/H6&gt;&lt;H6&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;tbl_Date&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;tbl_ReportData&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/H6&gt;&lt;H6&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;tbl_Date&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;tbl_ReportData&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/H6&gt;&lt;H6&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/H6&gt;&lt;H6&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/H6&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;This is the prior year measure along with the error I am receiving:&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;H6&gt;&lt;FONT color="#333399"&gt;&lt;SPAN&gt;PY Revenue =&lt;/SPAN&gt; &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Custom Sales]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;DATEADD&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;tbl_ReportData&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;,-&lt;/SPAN&gt;&lt;SPAN&gt;365&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;DAY&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/H6&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 May 2024 01:54:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-With-Inconsistent-Date-Range/m-p/3937526#M153127</guid>
      <dc:creator>dhenders1833</dc:creator>
      <dc:date>2024-05-22T01:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADD With Inconsistent Date Range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-With-Inconsistent-Date-Range/m-p/3937597#M153131</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="745465" data-lia-user-login="dhenders1833" class="lia-mention lia-mention-user"&gt;dhenders1833&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try using your date table in the DATEADD.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;PY Revenue = CALCULATE( [Custom Sales], DATEADD( tbl_Date[Date], -365, DAY ) )&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 May 2024 02:25:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-With-Inconsistent-Date-Range/m-p/3937597#M153131</guid>
      <dc:creator>gmsamborn</dc:creator>
      <dc:date>2024-05-22T02:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADD With Inconsistent Date Range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-With-Inconsistent-Date-Range/m-p/3939860#M153176</link>
      <description>&lt;P&gt;Thanks for the recommendation, however that yields the same error as well.&amp;nbsp; It will allow me to pull into the visual alone, however when I pull in store number it then errors out.&lt;/P&gt;&lt;P&gt;Without store #:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;With store #:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 12:54:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-With-Inconsistent-Date-Range/m-p/3939860#M153176</guid>
      <dc:creator>dhenders1833</dc:creator>
      <dc:date>2024-05-22T12:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADD With Inconsistent Date Range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-With-Inconsistent-Date-Range/m-p/3940211#M153198</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="745465" data-lia-user-login="dhenders1833" class="lia-mention lia-mention-user"&gt;dhenders1833&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you replicate this problem with a small sample pbix?&amp;nbsp; &amp;nbsp;(I've tried a couple of simple examples and mine seem to work as expected.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, can you double-check the error for your most recent example?&amp;nbsp; The previous error had to do with date tables in particular.&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 16:09:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-With-Inconsistent-Date-Range/m-p/3940211#M153198</guid>
      <dc:creator>gmsamborn</dc:creator>
      <dc:date>2024-05-22T16:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: DATEADD With Inconsistent Date Range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-With-Inconsistent-Date-Range/m-p/3941164#M153229</link>
      <description>&lt;P&gt;Hi-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see example at link below.&amp;nbsp; Essentially I am unable to get the PY measure to calculate properly.&amp;nbsp; If I use PARALLELPERIOD, it calculates however the amount is incorrect.&amp;nbsp; If I use DATEADD, it will not allow me to pull into the visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe the issue it due to the fact that Store 202 does not have data for Apr 2024.&amp;nbsp; However in my actual dataset, I want the ability to still be able to calculate PY in spite of this, and I want to have a separate slicer that will allow the user to toggle between comp, non comp, and all stores.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1BZrWk8RtIcTZBRL5JiDrnO8cVCYT4O9t/view?usp=drive_link" target="_blank"&gt;https://drive.google.com/file/d/1BZrWk8RtIcTZBRL5JiDrnO8cVCYT4O9t/view?usp=drive_link&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 02:24:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEADD-With-Inconsistent-Date-Range/m-p/3941164#M153229</guid>
      <dc:creator>dhenders1833</dc:creator>
      <dc:date>2024-05-23T02:24:47Z</dc:date>
    </item>
  </channel>
</rss>

