<?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: DAX to calculate difference between two dates in same column with conditions ! in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-difference-between-two-dates-in-same-column/m-p/2689519#M80937</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="396495" data-lia-user-login="Shak_95" class="lia-mention lia-mention-user"&gt;Shak_95&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Suppose there is a table like this(There should be an invoice id column):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Then new a calculated column:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;days = 
VAR _mindate =
    CALCULATE (
        MIN ( 'Table'[CPUDT_DATE] ),
        FILTER (
            'Table',
            'Table'[BEWTP] = "E"
                &amp;amp;&amp;amp; 'Table'[BWART] = 101
                &amp;amp;&amp;amp; 'Table'[WERKS] = 1000
                &amp;amp;&amp;amp; 'Table'[ID] = EARLIER ( 'Table'[ID] )
        )
    )
VAR _maxdate =
    CALCULATE (
        MAX ( 'Table'[CPUDT_DATE] ),
        FILTER (
            'Table',
            'Table'[BEWTP] = "Q"
                &amp;amp;&amp;amp; 'Table'[SHKZG] = "S"
                &amp;amp;&amp;amp; 'Table'[WERKS] = 1000
                &amp;amp;&amp;amp; 'Table'[ID] = EARLIER ( 'Table'[ID] )
        )
    )
VAR _difference =
    DATEDIFF ( _mindate, _maxdate, DAY )
RETURN
    _difference&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The PBIX file is attached for reference.&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/19IVIZ2_kGazl0njzUBbbGYHy-FQ53e3G/view?usp=sharing" target="_blank" rel="noopener"&gt;PBIX file&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;changqing&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Aug 2022 10:15:36 GMT</pubDate>
    <dc:creator>changqing</dc:creator>
    <dc:date>2022-08-09T10:15:36Z</dc:date>
    <item>
      <title>DAX to calculate difference between two dates in same column with conditions !</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-difference-between-two-dates-in-same-column/m-p/2679805#M80221</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;I need to calculate the difference between the date of receipt of the invoice and the date of payment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Challenge: The two dates are in one column,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;- to get the date of receipt of the invoice I need to apply this condition :&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;BEWTP=E and BWART=101 and WERKS=1000&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;- to get the date of payment I need to apply this condition &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;BEWTP=Q and SHKZG=S and WERKS=1000&amp;nbsp;&lt;/FONT&gt;&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your answer is appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 20:15:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-difference-between-two-dates-in-same-column/m-p/2679805#M80221</guid>
      <dc:creator>Shak_95</dc:creator>
      <dc:date>2022-08-03T20:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to calculate difference between two dates in same column with conditions !</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-difference-between-two-dates-in-same-column/m-p/2680235#M80250</link>
      <description>&lt;P&gt;I think that you can try to use SUMMARIZE and after that use ADDCOLUMNS with MAX(Date) - MIN(Date)&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 01:28:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-difference-between-two-dates-in-same-column/m-p/2680235#M80250</guid>
      <dc:creator>technolog</dc:creator>
      <dc:date>2022-08-04T01:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to calculate difference between two dates in same column with conditions !</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-difference-between-two-dates-in-same-column/m-p/2680604#M80269</link>
      <description>&lt;P&gt;thank you for your reply&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly, can you share the expression and steps that achieves what i want.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 06:21:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-difference-between-two-dates-in-same-column/m-p/2680604#M80269</guid>
      <dc:creator>Shak_95</dc:creator>
      <dc:date>2022-08-04T06:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to calculate difference between two dates in same column with conditions !</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-difference-between-two-dates-in-same-column/m-p/2684233#M80497</link>
      <description>&lt;P&gt;kindly help&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 13:00:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-difference-between-two-dates-in-same-column/m-p/2684233#M80497</guid>
      <dc:creator>Shak_95</dc:creator>
      <dc:date>2022-08-05T13:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to calculate difference between two dates in same column with conditions !</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-difference-between-two-dates-in-same-column/m-p/2685204#M80588</link>
      <description>&lt;P&gt;UP&lt;/P&gt;</description>
      <pubDate>Sat, 06 Aug 2022 14:51:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-difference-between-two-dates-in-same-column/m-p/2685204#M80588</guid>
      <dc:creator>Shak_95</dc:creator>
      <dc:date>2022-08-06T14:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to calculate difference between two dates in same column with conditions !</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-difference-between-two-dates-in-same-column/m-p/2689519#M80937</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="396495" data-lia-user-login="Shak_95" class="lia-mention lia-mention-user"&gt;Shak_95&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Suppose there is a table like this(There should be an invoice id column):&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Then new a calculated column:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;days = 
VAR _mindate =
    CALCULATE (
        MIN ( 'Table'[CPUDT_DATE] ),
        FILTER (
            'Table',
            'Table'[BEWTP] = "E"
                &amp;amp;&amp;amp; 'Table'[BWART] = 101
                &amp;amp;&amp;amp; 'Table'[WERKS] = 1000
                &amp;amp;&amp;amp; 'Table'[ID] = EARLIER ( 'Table'[ID] )
        )
    )
VAR _maxdate =
    CALCULATE (
        MAX ( 'Table'[CPUDT_DATE] ),
        FILTER (
            'Table',
            'Table'[BEWTP] = "Q"
                &amp;amp;&amp;amp; 'Table'[SHKZG] = "S"
                &amp;amp;&amp;amp; 'Table'[WERKS] = 1000
                &amp;amp;&amp;amp; 'Table'[ID] = EARLIER ( 'Table'[ID] )
        )
    )
VAR _difference =
    DATEDIFF ( _mindate, _maxdate, DAY )
RETURN
    _difference&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The PBIX file is attached for reference.&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/19IVIZ2_kGazl0njzUBbbGYHy-FQ53e3G/view?usp=sharing" target="_blank" rel="noopener"&gt;PBIX file&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;changqing&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 10:15:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-difference-between-two-dates-in-same-column/m-p/2689519#M80937</guid>
      <dc:creator>changqing</dc:creator>
      <dc:date>2022-08-09T10:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to calculate difference between two dates in same column with conditions !</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-difference-between-two-dates-in-same-column/m-p/2690445#M80988</link>
      <description>&lt;P&gt;Thank you very much &lt;SPAN&gt;changqing&amp;nbsp;&lt;/SPAN&gt;for your help, i appreciate it&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 15:25:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-calculate-difference-between-two-dates-in-same-column/m-p/2690445#M80988</guid>
      <dc:creator>Shak_95</dc:creator>
      <dc:date>2022-08-09T15:25:50Z</dc:date>
    </item>
  </channel>
</rss>

