<?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 filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-filter/m-p/783154#M4194</link>
    <description>&lt;P&gt;End_date =&lt;BR /&gt;IF (&lt;BR /&gt;Test[new status] = "B",&lt;BR /&gt;DATEDIFF (&lt;BR /&gt;CALCULATE (&lt;BR /&gt;MAX ( Test[old date] ),&lt;BR /&gt;FILTER ( Test, Test[old date] &amp;lt; EARLIER ( Test[old date] ) )&lt;BR /&gt;),&lt;BR /&gt;Test[old date],&lt;BR /&gt;DAY&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Wed, 04 Sep 2019 07:13:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-09-04T07:13:02Z</dc:date>
    <item>
      <title>DATEDIFF with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-filter/m-p/769728#M3623</link>
      <description>&lt;P&gt;Hallo everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table that looks something like this,&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Job&lt;/TD&gt;&lt;TD&gt;old status&lt;/TD&gt;&lt;TD&gt;new status&lt;/TD&gt;&lt;TD&gt;old date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;115728&lt;/TD&gt;&lt;TD&gt;o&lt;/TD&gt;&lt;TD&gt;TG&lt;/TD&gt;&lt;TD&gt;18-1-2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;115728&lt;/TD&gt;&lt;TD&gt;TG&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;2-3-2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;115728&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;2-3-2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;TG&lt;/TD&gt;&lt;TD&gt;6-2-2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;TG&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;7-2-2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;8-2-2019&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to now when a job has a new status B (busy) how long did this take?&lt;/P&gt;&lt;P&gt;so for example joborder 115728 got the status B at 2-3-2018, therefore it has status TG 18-1-2018.&lt;/P&gt;&lt;P&gt;the outcome must be the datedifferents between 2-3-2018-18-1-2018 in days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can somebody help me with a measure or a calculated column if a measure is not possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Charaf&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 11:08:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-filter/m-p/769728#M3623</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-19T11:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: DATEDIFF with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-filter/m-p/769749#M3624</link>
      <description>The formulation of the conditions is ambiguous. Please give a full explanation of what you want to calculate for Job 200 as it looks like a job can go through stage B several times.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D.</description>
      <pubDate>Mon, 19 Aug 2019 11:34:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-filter/m-p/769749#M3624</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-19T11:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: DATEDIFF with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-filter/m-p/769767#M3625</link>
      <description>&lt;P&gt;Job 200 = new status "B" = old status TG&lt;/P&gt;&lt;P&gt;TG had new status date&amp;nbsp;6-2-2019 -&amp;nbsp; B had the new status date 7-2-2019.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so the new status B from the old status TG is one day old.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this is better. Anonymous&lt;/LI-USER&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 12:06:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-filter/m-p/769767#M3625</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-19T12:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: DATEDIFF with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-filter/m-p/773546#M3807</link>
      <description>&lt;P&gt;anyone else who can help me?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 19:38:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-filter/m-p/773546#M3807</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-22T19:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: DATEDIFF with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-filter/m-p/783154#M4194</link>
      <description>&lt;P&gt;End_date =&lt;BR /&gt;IF (&lt;BR /&gt;Test[new status] = "B",&lt;BR /&gt;DATEDIFF (&lt;BR /&gt;CALCULATE (&lt;BR /&gt;MAX ( Test[old date] ),&lt;BR /&gt;FILTER ( Test, Test[old date] &amp;lt; EARLIER ( Test[old date] ) )&lt;BR /&gt;),&lt;BR /&gt;Test[old date],&lt;BR /&gt;DAY&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 07:13:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-filter/m-p/783154#M4194</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-04T07:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: DATEDIFF with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-filter/m-p/783265#M4197</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp; thank you for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;im feeling im getting close.&lt;/P&gt;&lt;P&gt;The picture shows the results that i get. the day counts is not the correct outcoming.&lt;/P&gt;&lt;P&gt;I dont understand where this 4 comes from?&amp;nbsp; the difference between 30 april 2018 - 1 may 2018 = not 4 days.&lt;/P&gt;&lt;P&gt;can you help me with that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i think CHR_OLDVALUE&amp;nbsp; and CRH_EVENT is missing in the formula.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 08:48:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-filter/m-p/783265#M4197</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-04T08:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: DATEDIFF with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-filter/m-p/784636#M4255</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code does exactly what you need it to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Previous Date =
VAR PreviousRow =
    TOPN (
        1;
        FILTER (
            Blad1;
            Blad1[&lt;SPAN&gt;old date&lt;/SPAN&gt;] &amp;lt; EARLIER ( Blad1[CRH_REQDATE] )
                &amp;amp;&amp;amp; Blad1[job] = EARLIER ( Blad1[job] )
        );
        Blad1[old date]; DESC
    )
VAR PreviousValue =
    MINX ( PreviousRow; Blad1[old date] )
RETURN
    DATEDIFF ( PreviousValue; Blad1[old date]; DAY )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply solved your issues be sure to mark it as the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 10:57:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-filter/m-p/784636#M4255</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-05T10:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: DATEDIFF with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-filter/m-p/784888#M4265</link>
      <description>&lt;P&gt;shout out to&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp; you the man.&lt;/P&gt;&lt;P&gt;thanks alot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Charaf&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 16:18:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-with-filter/m-p/784888#M4265</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-05T16:18:52Z</dc:date>
    </item>
  </channel>
</rss>

