<?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: Creating DAX rules for calculating time difference between received and sent dates of a ticket in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-DAX-rules-for-calculating-time-difference-between/m-p/3180045#M114941</link>
    <description>&lt;P&gt;Hi Jack you can add an IF stament to the days between calc as below&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;this should now show any days that are less than zero as zero&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Apr 2023 14:55:40 GMT</pubDate>
    <dc:creator>P_d2023</dc:creator>
    <dc:date>2023-04-10T14:55:40Z</dc:date>
    <item>
      <title>Creating DAX rules for calculating time difference between received and sent dates of a ticket</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-DAX-rules-for-calculating-time-difference-between/m-p/3179121#M114894</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I want to create Dax rules to display two dates when the ID_Reciever received the ticket_ID (based on the ID_Receiver column), and simultaneously be able to display the date when the ID_assistant sent the ticket_ID (based on ID_Assistant column), then I want another separate DAX code to calculate time difference between the two dates.&lt;BR /&gt;&lt;BR /&gt;For example, Received ID SD00316 (Kobbe Bryan), received ticket (DOSSIER_Nb) 15729697 on 21/02/2023, then his same "assistant ID" SD00316, sent the ticket 15729697 on 23/02/2023, the time in days it took Kobbe Bryan to treat this ticket is 2 days. How can I translate this into DAX functions please.&lt;BR /&gt;&lt;BR /&gt;This is based on the table below:&lt;BR /&gt;&lt;BR /&gt;DOSSIER_Nb&amp;nbsp;&lt;STRONG&gt;Date_Action&lt;/STRONG&gt; Name Assistant &lt;STRONG&gt;ID_Assistant&lt;/STRONG&gt; ID_Receiver &lt;STRONG&gt;Name Receiver&lt;/STRONG&gt;&lt;BR /&gt;15729697 &lt;STRONG&gt;21/02/2023&lt;/STRONG&gt; Jennifer Johnson &lt;STRONG&gt;E580333&lt;/STRONG&gt;&amp;nbsp; SD00316 &lt;STRONG&gt;Kobbe Bryan&lt;/STRONG&gt;&lt;BR /&gt;15729697 &lt;STRONG&gt;23/02/2023&lt;/STRONG&gt; Kobbe Bryan &lt;STRONG&gt;SD00316&lt;/STRONG&gt; E580333 &lt;STRONG&gt;Jennifer Johnson&lt;/STRONG&gt;&lt;BR /&gt;15729697 &lt;STRONG&gt;14/03/2023&lt;/STRONG&gt; Jennifer Johnson &lt;STRONG&gt;E580333&lt;/STRONG&gt; SD00316 &lt;STRONG&gt;Kobbe Bryan&lt;/STRONG&gt;&lt;BR /&gt;15729697 &lt;STRONG&gt;21/03/2023&lt;/STRONG&gt; Kobbe Bryan &lt;STRONG&gt;SD00316&lt;/STRONG&gt; E580333 &lt;STRONG&gt;Jennifer Johnson&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;I tried the following three DAX codes, but nothing seems to work:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Received Date = CALCULATE ( MAX ( 'WEEKLY_IDs'[Date_Action] ), FILTER ( 'WEEKLY_IDs', 'WEEKLY_IDs'[DOSSIER_Nb] = 'WEEKLY_IDs'[DOSSIER_Nb] &amp;amp;&amp;amp; 'WEEKLY_IDs'[ID_Receiver] = 'WEEKLY_IDs'[ID_Receiver] ) )&lt;BR /&gt;&lt;BR /&gt;Sent Date = CALCULATE ( MAX ( 'WEEKLY_IDs'[Date_Action] ), FILTER ( 'WEEKLY_IDs', 'WEEKLY_IDs'[DOSSIER_Nb] = 'WEEKLY_IDs'[DOSSIER_Nb] &amp;amp;&amp;amp; 'WEEKLY_IDs'[ID_Assistant] = 'WEEKLY_IDs'[ID_Assistant] ) )&lt;BR /&gt;&lt;BR /&gt;DaysBetween =&lt;BR /&gt;&lt;BR /&gt;VAR current_ticket_id = MAX(WEEKLY_IDs[DOSSIER_Nb])&lt;BR /&gt;VAR current_recipient_id = MAX(WEEKLY_IDs[ID_Receiver])&lt;BR /&gt;VAR current_assistant_id = MAX(WEEKLY_IDs[ID_Assistant])&lt;BR /&gt;VAR received_date = CALCULATE( &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;MAX(WEEKLY_IDs[Date_Action]), &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;FILTER( &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;WEEKLY_IDs, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;WEEKLY_IDs[DOSSIER_Nb] = current_ticket_id &amp;amp;&amp;amp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;WEEKLY_IDs[ID_Receiver] = current_recipient_id &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;BR /&gt;&lt;BR /&gt;VAR sent_date = CALCULATE( &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;MAX(WEEKLY_IDs[Date_Action]), &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;FILTER( &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;WEEKLY_IDs, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;WEEKLY_IDs[DOSSIER_Nb] = current_ticket_id &amp;amp;&amp;amp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;WEEKLY_IDs[ID_Assistant] = current_assistant_id &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;BR /&gt;RETURN DATEDIFF(sent_date, received_date, DAY)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 00:55:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-DAX-rules-for-calculating-time-difference-between/m-p/3179121#M114894</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-10T00:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating DAX rules for calculating time difference between received and sent dates of a ticket</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-DAX-rules-for-calculating-time-difference-between/m-p/3179798#M114920</link>
      <description>&lt;P&gt;Hi, it is tricky as you dont have anything to show when it is a request or a reply&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have got through this by first creating 2 custom columns&lt;/P&gt;&lt;P&gt;column 1 ticket timeline. this now ranks the ticket lines in order of date&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;secondly i created a new custom column that that ranks the assistant name by date filtered by the ticket&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;with the 2 columns we can now create measures to calculate what you are looking for&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure one is ticket_first_recieved_date&lt;/P&gt;&lt;P&gt;this gives us the first time the ticket existed&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;second measure is first time someone replied that is different than the first sender&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;once we have the 2 dates we can now calculate the days between in a measure&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;now we have all the information we can put this into a table as below&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;please tick if this is the solution to your issue&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 11:52:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-DAX-rules-for-calculating-time-difference-between/m-p/3179798#M114920</guid>
      <dc:creator>P_d2023</dc:creator>
      <dc:date>2023-04-10T11:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Creating DAX rules for calculating time difference between received and sent dates of a ticket</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-DAX-rules-for-calculating-time-difference-between/m-p/3180029#M114939</link>
      <description>&lt;P&gt;Kudos to you, BIG Thank you, your answers helped resolve this problem, I just have one question, for the tickets that treated on the same days, it's natural that they don't have a reply date, when I applied the last measure, I get a significant negative number that I just want to show as zero, how can I accomplish this please?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 14:47:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-DAX-rules-for-calculating-time-difference-between/m-p/3180029#M114939</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-10T14:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Creating DAX rules for calculating time difference between received and sent dates of a ticket</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-DAX-rules-for-calculating-time-difference-between/m-p/3180045#M114941</link>
      <description>&lt;P&gt;Hi Jack you can add an IF stament to the days between calc as below&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;this should now show any days that are less than zero as zero&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 14:55:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-DAX-rules-for-calculating-time-difference-between/m-p/3180045#M114941</guid>
      <dc:creator>P_d2023</dc:creator>
      <dc:date>2023-04-10T14:55:40Z</dc:date>
    </item>
  </channel>
</rss>

