<?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: Subtract two date columns in  existing table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/2195521#M51412</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="136873" data-lia-user-login="sdhn" class="lia-mention lia-mention-user"&gt;sdhn&lt;/a&gt;&amp;nbsp; you can create a measure like this&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;difference = DATEDIFF(MAX('Table'[Created date]),MAX('Table'[Resolved date]),DAY)&lt;/LI-CODE&gt;
&lt;P&gt;or&amp;nbsp; a calulated column&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = CONVERT('Table'[Resolved date]-'Table'[Created date],DOUBLE)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;whatever you prefer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Nov 2021 00:53:20 GMT</pubDate>
    <dc:creator>smpa01</dc:creator>
    <dc:date>2021-11-18T00:53:20Z</dc:date>
    <item>
      <title>Subtract two date columns in  existing table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/2195468#M51408</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Power Bi Desktop to develop report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to add new&amp;nbsp;column that computes elapsed time (Resolved date&amp;nbsp; – Created date = Elapsed)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both columns are date. Do I need to write mesaure ?&amp;nbsp; etc&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 23:34:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/2195468#M51408</guid>
      <dc:creator>sdhn</dc:creator>
      <dc:date>2021-11-17T23:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract two date columns in  existing table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/2195521#M51412</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="136873" data-lia-user-login="sdhn" class="lia-mention lia-mention-user"&gt;sdhn&lt;/a&gt;&amp;nbsp; you can create a measure like this&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;difference = DATEDIFF(MAX('Table'[Created date]),MAX('Table'[Resolved date]),DAY)&lt;/LI-CODE&gt;
&lt;P&gt;or&amp;nbsp; a calulated column&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = CONVERT('Table'[Resolved date]-'Table'[Created date],DOUBLE)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;whatever you prefer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 00:53:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/2195521#M51412</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-11-18T00:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract two date columns in  existing table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/2195973#M51431</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="136873" data-lia-user-login="sdhn" class="lia-mention lia-mention-user"&gt;sdhn&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Elapsed = [Resolved date]-[Created date]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And change the new column data type to Whole number, Output:&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;helps&lt;/SPAN&gt;&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;accepting&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;it as the solution&lt;/SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;Appreciate your Kudos!!&lt;BR /&gt;&lt;STRONG&gt;LinkedIn:&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;A href="https://www.linkedin.com/in/vahid-dm/" target="_blank"&gt;www.linkedin.com/in/vahid-dm/&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 07:14:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/2195973#M51431</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-11-18T07:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract two date columns in  existing table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/2196967#M51480</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your feedback. But I am not getting correct values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1)&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Elapsed = &lt;/SPAN&gt;&lt;SPAN&gt;CONVERT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Incident[Resolved Date Time]&lt;/SPAN&gt;&lt;SPAN&gt;)-&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Incident[Created]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;DOUBLE&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Elapsed Diff = &lt;/SPAN&gt;&lt;SPAN&gt;DATEDIFF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Incident[Created]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Incident[Resolved Date Time]&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;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 18 Nov 2021 15:38:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/2196967#M51480</guid>
      <dc:creator>sdhn</dc:creator>
      <dc:date>2021-11-18T15:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract two date columns in  existing table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/2196998#M51482</link>
      <description>&lt;P&gt;Hi there ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;This seems work. Only issue when we have no value in Resolved date time gives some numbers as:&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;</description>
      <pubDate>Thu, 18 Nov 2021 15:47:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/2196998#M51482</guid>
      <dc:creator>sdhn</dc:creator>
      <dc:date>2021-11-18T15:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract two date columns in  existing table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/2199415#M51590</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="136873" data-lia-user-login="sdhn" class="lia-mention lia-mention-user"&gt;sdhn&lt;/a&gt;&amp;nbsp;did you try the above?&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2021 03:17:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/2199415#M51590</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-11-20T03:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract two date columns in  existing table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/2201789#M51697</link>
      <description>&lt;P&gt;Elapsed =&lt;/P&gt;&lt;P&gt;VAR _diff = [Resolved Date Time] - [Created]&lt;/P&gt;&lt;P&gt;RETURN IF([Resolved Date Time]=BLANK(),0,_diff)&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 15:08:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/2201789#M51697</guid>
      <dc:creator>sdhn</dc:creator>
      <dc:date>2021-11-22T15:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract two date columns in  existing table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/3658299#M141742</link>
      <description>&lt;P&gt;Yeah, I don't get that either with my table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Days Overdue =&lt;/SPAN&gt; &lt;SPAN&gt;[Created Date]&lt;/SPAN&gt;&lt;SPAN&gt; - &lt;/SPAN&gt;&lt;SPAN&gt;[Due Date]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I get the error:&amp;nbsp;&amp;nbsp;The value for 'Created Date' cannot be determined. Either the column doesn't exist, or there is no current row for this column.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 24 Jan 2024 23:51:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/3658299#M141742</guid>
      <dc:creator>NotMyJob</dc:creator>
      <dc:date>2024-01-24T23:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract two date columns in  existing table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/3658302#M141743</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/136873" target="_blank"&gt;@sdhn&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;, see the comment about about the error I get with that equation:&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;The value for 'Created Date' cannot be determined. Either the column doesn't exist, or there is no current row for this column.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 23:53:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-two-date-columns-in-existing-table/m-p/3658302#M141743</guid>
      <dc:creator>NotMyJob</dc:creator>
      <dc:date>2024-01-24T23:53:05Z</dc:date>
    </item>
  </channel>
</rss>

