<?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: Subtracting two date columns in two different tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtracting-two-date-columns-in-two-different-tables/m-p/2431589#M64730</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374063" data-lia-user-login="Ronning" class="lia-mention lia-mention-user"&gt;Ronning&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;If there is a relationship between th etwo tables then if table1 is at the many side and table2 is at the one side and assuming that&amp;nbsp;&lt;SPAN&gt;'Table1'[Column] is the earlier date and&amp;nbsp;'Table2'[Column] is the later date then you can use&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;# Days =
SUMX (
    'Table1',
    DATEDIFF ( 'Table1'[Column], RELATED ( 'Table2'[Column] ), DAY )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Apr 2022 09:30:40 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-04-01T09:30:40Z</dc:date>
    <item>
      <title>Subtracting two date columns in two different tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtracting-two-date-columns-in-two-different-tables/m-p/2431498#M64724</link>
      <description>&lt;P&gt;Hi, I have a problem with subtracting two date columns from different tables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried this.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DATEDIFF(&amp;nbsp; SUM( 'Table' [Column] ) , SUM( 'Table' [Column]) , DAY ).&lt;/P&gt;&lt;P&gt;But when i drag this measuer into a table it gives me this message.&lt;/P&gt;&lt;P&gt;" An unvalid numerical representation of a datevalue has occoured"&lt;/P&gt;&lt;P&gt;Could this be because thera are some future date in one column that dosent exist in the other ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 09:01:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtracting-two-date-columns-in-two-different-tables/m-p/2431498#M64724</guid>
      <dc:creator>Ronning</dc:creator>
      <dc:date>2022-04-01T09:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Subtracting two date columns in two different tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtracting-two-date-columns-in-two-different-tables/m-p/2431589#M64730</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374063" data-lia-user-login="Ronning" class="lia-mention lia-mention-user"&gt;Ronning&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;If there is a relationship between th etwo tables then if table1 is at the many side and table2 is at the one side and assuming that&amp;nbsp;&lt;SPAN&gt;'Table1'[Column] is the earlier date and&amp;nbsp;'Table2'[Column] is the later date then you can use&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;# Days =
SUMX (
    'Table1',
    DATEDIFF ( 'Table1'[Column], RELATED ( 'Table2'[Column] ), DAY )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 09:30:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtracting-two-date-columns-in-two-different-tables/m-p/2431589#M64730</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-04-01T09:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Subtracting two date columns in two different tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtracting-two-date-columns-in-two-different-tables/m-p/2431635#M64734</link>
      <description>&lt;P&gt;I found out the problem... It was just to change SUM to MAX.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 09:46:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtracting-two-date-columns-in-two-different-tables/m-p/2431635#M64734</guid>
      <dc:creator>Ronning</dc:creator>
      <dc:date>2022-04-01T09:46:25Z</dc:date>
    </item>
  </channel>
</rss>

