<?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: How to add 180 days to a start date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-add-180-days-to-a-start-date/m-p/2222368#M52798</link>
    <description>&lt;P&gt;Thank you very much!&lt;BR /&gt;Is it the same logic behind DATEDIFF?&lt;/P&gt;</description>
    <pubDate>Mon, 06 Dec 2021 08:32:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-12-06T08:32:52Z</dc:date>
    <item>
      <title>How to add 180 days to a start date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-add-180-days-to-a-start-date/m-p/2217912#M52541</link>
      <description>&lt;P&gt;Hi everyone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to do a very simple excercise where I want to add 180 days to a start date by using the following DAX to create a calculated column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Calculated deadline = &lt;/SPAN&gt;&lt;SPAN&gt;DATEADD&lt;/SPAN&gt;&lt;SPAN&gt;('Cases'&lt;/SPAN&gt;&lt;SPAN&gt;[Case.Startdate]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;180&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;DAY&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;It works fine in most of the rows, but it seems to fail several times, and I can't figure out why. Maybe someone can help me?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Error 1: If the Calculated deadline is in the future, the row is just blank&lt;/DIV&gt;&lt;DIV&gt;Error 2: Most of the cases with an old startdate (before 2010) is also blank&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Both of the columns are created with the same date-format.&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 10:12:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-add-180-days-to-a-start-date/m-p/2217912#M52541</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-02T10:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 180 days to a start date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-add-180-days-to-a-start-date/m-p/2218068#M52545</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are just wanting to add 180 days to a scalar date value, I would recommend you just add 180:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Calculated deadline =
'Cases'[Case.Startdate] + 180&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATEADD is not suitable for what you are doing here, i.e. adding or subtracting from a scalar date value. It's a table function which returns a column of date values by shifting an initial set of values by a specified number of periods. It is often used for modifying date filters as part of a measure calculation. It just so happens that it can return a single-date table which is converted to a scalar when called in a row context which contains the date you are shifting. It can only return dates that exist in the column referenced in the first argument (and includes an automatic context transition, see article linked below), which likely explains the blanks you were getting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See here for a general description:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://dax.guide/DATEADD/" target="_blank" rel="noopener"&gt;https://dax.guide/DATEADD/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Owen&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 12:07:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-add-180-days-to-a-start-date/m-p/2218068#M52545</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2021-12-02T12:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 180 days to a start date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-add-180-days-to-a-start-date/m-p/2222368#M52798</link>
      <description>&lt;P&gt;Thank you very much!&lt;BR /&gt;Is it the same logic behind DATEDIFF?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 08:32:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-add-180-days-to-a-start-date/m-p/2222368#M52798</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-06T08:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 180 days to a start date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-add-180-days-to-a-start-date/m-p/2224772#M52928</link>
      <description>&lt;P&gt;You're welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding DATEDIFF, yes, it's similar in that it operates on datetime scalars, and returns a scalar value. It calculates how many "interval boundaries" are crossed from one datetime value to another.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using your example, if d1 &amp;amp; d2 are dates and d2 = d1 + 180, then DATEDIFF ( d1, d2, DAY ) = 180.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Owen&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 08:29:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-add-180-days-to-a-start-date/m-p/2224772#M52928</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2021-12-07T08:29:07Z</dc:date>
    </item>
  </channel>
</rss>

