<?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: DATEDIFF with values in different Rows and Fields in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-values-in-different-Rows-and-Fields/m-p/1861369#M39881</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="66965" data-lia-user-login="DaniBi92" class="lia-mention lia-mention-user"&gt;DaniBi92&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please check the below picture and the sample pbix file's link down below.&lt;/P&gt;&lt;P&gt;All measures are in the sample b pbix file, and all steps are numbered in front of each measure.&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;A href="https://www.dropbox.com/s/4lwg972lhq9ki9q/danibi.pbix?dl=0" target="_self"&gt;https://www.dropbox.com/s/4lwg972lhq9ki9q/danibi.pbix?dl=0&lt;/A&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;FONT face="”calibri" color="”#0000FF”"&gt;&lt;STRONG&gt;Hi, My name is Jihwan Kim. &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;STRONG&gt;If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up. &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;Linkedin: linkedin.com/in/jihwankim1975/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;Twitter: twitter.com/Jihwan_JHKIM&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 25 May 2021 02:52:48 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2021-05-25T02:52:48Z</dc:date>
    <item>
      <title>DATEDIFF with values in different Rows and Fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-values-in-different-Rows-and-Fields/m-p/1860900#M39866</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;is it possible to use a DATEDIFF formulas with values in different Rows and Fields(or another DAX formulas)?&lt;/P&gt;&lt;P&gt;For example, i 've the following Data:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ITEM&lt;/TD&gt;&lt;TD&gt;STATUS&lt;/TD&gt;&lt;TD&gt;DATE1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DATE2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;XXX&lt;/TD&gt;&lt;TD&gt;Receipt&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 01/05/2021&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;XXX&lt;/TD&gt;&lt;TD&gt;Delivery&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;05/05/2021&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;YYY&lt;/TD&gt;&lt;TD&gt;Receipt&lt;/TD&gt;&lt;TD&gt;04/04/2021&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ZZZ&lt;/TD&gt;&lt;TD&gt;Receipt&lt;/TD&gt;&lt;TD&gt;30/04/2021&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;YYY&lt;/TD&gt;&lt;TD&gt;Delivery&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 07/04/2021&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ZZZ&lt;/TD&gt;&lt;TD&gt;Delivery&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11/05/2021&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;The result that i need is the sum of the days difference by Item. In my exemple the result must be 18:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ITEM&lt;/TD&gt;&lt;TD&gt;DATE1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DATE2&lt;/TD&gt;&lt;TD&gt;RESULTS&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;XXX&lt;/TD&gt;&lt;TD&gt;01/05/2021&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 05/05/2021&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;YYY&lt;/TD&gt;&lt;TD&gt;04/04/2021&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 07/04/2021&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ZZZ&lt;/TD&gt;&lt;TD&gt;30/04/2021&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11/05/2021&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;RESULT:&lt;/TD&gt;&lt;TD&gt;18&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Is there a DAX formulas to achive this result?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 19:20:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-values-in-different-Rows-and-Fields/m-p/1860900#M39866</guid>
      <dc:creator>DaniBi92</dc:creator>
      <dc:date>2021-05-24T19:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: DATEDIFF with values in different Rows and Fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-values-in-different-Rows-and-Fields/m-p/1860921#M39867</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="66965" data-lia-user-login="DaniBi92" class="lia-mention lia-mention-user"&gt;DaniBi92&lt;/a&gt;&amp;nbsp;See my article on Mean Time Between Failure (MTBF) which uses EARLIER: &lt;A href="http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586" target="_blank"&gt;http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586&lt;/A&gt;.&lt;BR /&gt;The basic pattern is:&lt;BR /&gt;Column =&amp;nbsp;&lt;BR /&gt;&amp;nbsp; VAR __Current = [Value]&lt;BR /&gt;&amp;nbsp; VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] &amp;lt; EARLIER('Table'[Date])),[Date])&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])&lt;BR /&gt;RETURN&lt;BR /&gt;&amp;nbsp; __Current - __Previous&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 19:39:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-values-in-different-Rows-and-Fields/m-p/1860921#M39867</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-05-24T19:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: DATEDIFF with values in different Rows and Fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-values-in-different-Rows-and-Fields/m-p/1860951#M39869</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="66965" data-lia-user-login="DaniBi92" class="lia-mention lia-mention-user"&gt;DaniBi92&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You can create a DX table with the following code.&amp;nbsp; Click New Table under the Modeling tab and paste the code given below, rename the table name as per yours.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Result Table = 
ADDCOLUMNS(
    ADDCOLUMNS(
        VALUES(Table1[ITEM]),
        "DATE1", CALCULATE(MIN(Table1[DATE1])),
        "DATE2", CALCULATE(MIN(Table1[DATE2]))
    ),
    "RESULT", DATEDIFF([DATE1],[DATE2],DAY)
)&lt;/LI-CODE&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;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 19:52:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-values-in-different-Rows-and-Fields/m-p/1860951#M39869</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2021-05-24T19:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: DATEDIFF with values in different Rows and Fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-values-in-different-Rows-and-Fields/m-p/1861369#M39881</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="66965" data-lia-user-login="DaniBi92" class="lia-mention lia-mention-user"&gt;DaniBi92&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please check the below picture and the sample pbix file's link down below.&lt;/P&gt;&lt;P&gt;All measures are in the sample b pbix file, and all steps are numbered in front of each measure.&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;A href="https://www.dropbox.com/s/4lwg972lhq9ki9q/danibi.pbix?dl=0" target="_self"&gt;https://www.dropbox.com/s/4lwg972lhq9ki9q/danibi.pbix?dl=0&lt;/A&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;FONT face="”calibri" color="”#0000FF”"&gt;&lt;STRONG&gt;Hi, My name is Jihwan Kim. &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;&lt;STRONG&gt;If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up. &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;Linkedin: linkedin.com/in/jihwankim1975/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="”calibri" color="”#0000FF”"&gt;Twitter: twitter.com/Jihwan_JHKIM&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 May 2021 02:52:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-values-in-different-Rows-and-Fields/m-p/1861369#M39881</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2021-05-25T02:52:48Z</dc:date>
    </item>
  </channel>
</rss>

