<?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 How to calculate the average of the response time per conversation ID in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-response-time-per/m-p/2473091#M67422</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following table with conversations in Power BI:&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;In DAX, I want to calculate the average of the response time per conversation ID .&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Variable X = the 'created_at' variable from the first row where is_interaction = 1 (MARKED AS YELLOW)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Variable Y = the 'created_at' variable from the first row where owner_type = "Agent" and owner_id &amp;lt;&amp;gt; 1 after the first row where is_interaction = 1 (MARKED AS ORANGE)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With these variables I would like to calculate the average response time per conversation ID &lt;STRONG&gt;as a measure&lt;/STRONG&gt;.&amp;nbsp; As example I calculated the average response time for one conversation (MARKED AS BLUE)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on how to achieve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already have the measure to calculate the &lt;STRONG&gt;first&lt;/STRONG&gt; response time:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Response Time =

VAR _conversation_created_at =
CALCULATE(
MINX(
'table',
'table'[created_at]
),
'table'[is_interaction] = 1
)

VAR _conversation_response_created_at =
CALCULATE(
MINX(
'table',
'table'[created_at]
),
'table'[owner_type] = "Agent",
'table'[owner_id] &amp;lt;&amp;gt; 1,
'table'[created_at] &amp;gt; _conversation_created_at
)

VAR _result = DATEDIFF(_conversation_created_at, _conversation_response_created_at, MINUTE)

RETURN
_result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S.: this post is a continuation of the post &lt;LI-MESSAGE title="How to calculate the average of the 'first response' time per conversation ID" uid="2468808" url="https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-first-response-time-per/m-p/2468808#U2468808" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt; , credits for&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="377293" data-lia-user-login="SpartaBI" class="lia-mention lia-mention-user"&gt;SpartaBI&lt;/a&gt; solving this problem&lt;/P&gt;</description>
    <pubDate>Sun, 24 Apr 2022 16:35:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-04-24T16:35:02Z</dc:date>
    <item>
      <title>How to calculate the average of the response time per conversation ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-response-time-per/m-p/2473091#M67422</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following table with conversations in Power BI:&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;In DAX, I want to calculate the average of the response time per conversation ID .&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Variable X = the 'created_at' variable from the first row where is_interaction = 1 (MARKED AS YELLOW)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Variable Y = the 'created_at' variable from the first row where owner_type = "Agent" and owner_id &amp;lt;&amp;gt; 1 after the first row where is_interaction = 1 (MARKED AS ORANGE)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With these variables I would like to calculate the average response time per conversation ID &lt;STRONG&gt;as a measure&lt;/STRONG&gt;.&amp;nbsp; As example I calculated the average response time for one conversation (MARKED AS BLUE)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on how to achieve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already have the measure to calculate the &lt;STRONG&gt;first&lt;/STRONG&gt; response time:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Response Time =

VAR _conversation_created_at =
CALCULATE(
MINX(
'table',
'table'[created_at]
),
'table'[is_interaction] = 1
)

VAR _conversation_response_created_at =
CALCULATE(
MINX(
'table',
'table'[created_at]
),
'table'[owner_type] = "Agent",
'table'[owner_id] &amp;lt;&amp;gt; 1,
'table'[created_at] &amp;gt; _conversation_created_at
)

VAR _result = DATEDIFF(_conversation_created_at, _conversation_response_created_at, MINUTE)

RETURN
_result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S.: this post is a continuation of the post &lt;LI-MESSAGE title="How to calculate the average of the 'first response' time per conversation ID" uid="2468808" url="https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-first-response-time-per/m-p/2468808#U2468808" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt; , credits for&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="377293" data-lia-user-login="SpartaBI" class="lia-mention lia-mention-user"&gt;SpartaBI&lt;/a&gt; solving this problem&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2022 16:35:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-response-time-per/m-p/2473091#M67422</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-24T16:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the average of the response time per conversation ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-response-time-per/m-p/2473163#M67430</link>
      <description>&lt;P&gt;Hey&amp;nbsp;Anonymous&lt;/a&gt;,&amp;nbsp;just to make sure, you want it as a calculated column in your data model table and not as a measure?&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2022 10:03:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-response-time-per/m-p/2473163#M67430</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-04-24T10:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the average of the response time per conversation ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-response-time-per/m-p/2473166#M67432</link>
      <description>&lt;P&gt;Also, can you share the table in the pic as a table in a comment&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2022 10:08:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-response-time-per/m-p/2473166#M67432</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-04-24T10:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the average of the response time per conversation ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-response-time-per/m-p/2473320#M67454</link>
      <description>&lt;P&gt;Hey &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="377293" data-lia-user-login="SpartaBI" class="lia-mention lia-mention-user"&gt;SpartaBI&lt;/a&gt;&amp;nbsp;, I would like it as a measure to use it in a Report.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2022 16:27:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-response-time-per/m-p/2473320#M67454</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-24T16:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the average of the response time per conversation ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-response-time-per/m-p/2473321#M67455</link>
      <description>&lt;TABLE border="1" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;id&lt;/TD&gt;&lt;TD&gt;owner_type&lt;/TD&gt;&lt;TD&gt;owner_id&lt;/TD&gt;&lt;TD&gt;conversation_id&lt;/TD&gt;&lt;TD&gt;message&lt;/TD&gt;&lt;TD&gt;created_at&lt;/TD&gt;&lt;TD&gt;is_interaction&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;260943&lt;/TD&gt;&lt;TD&gt;Agent&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;26276&lt;/TD&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;2022-03-01 15:00:14&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;265544&lt;/TD&gt;&lt;TD&gt;Agent&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;26276&lt;/TD&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;2022-03-05 12:01:35&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;266749&lt;/TD&gt;&lt;TD&gt;Traveller&lt;/TD&gt;&lt;TD&gt;153263&lt;/TD&gt;&lt;TD&gt;26276&lt;/TD&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD&gt;2022-03-05 15:49:12&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;266750&lt;/TD&gt;&lt;TD&gt;Traveller&lt;/TD&gt;&lt;TD&gt;153263&lt;/TD&gt;&lt;TD&gt;26276&lt;/TD&gt;&lt;TD&gt;d&lt;/TD&gt;&lt;TD&gt;2022-03-05 15:49:22&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;266753&lt;/TD&gt;&lt;TD&gt;Agent&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;26276&lt;/TD&gt;&lt;TD&gt;e&lt;/TD&gt;&lt;TD&gt;2022-03-05 15:51:09&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;267003&lt;/TD&gt;&lt;TD&gt;Agent&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;26276&lt;/TD&gt;&lt;TD&gt;f&lt;/TD&gt;&lt;TD&gt;2022-03-06 12:01:23&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;268904&lt;/TD&gt;&lt;TD&gt;Agent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lt;/TD&gt;&lt;TD&gt;l&lt;/TD&gt;&lt;TD&gt;2022-03-10 12:01:26&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;272319&lt;/TD&gt;&lt;TD&gt;Traveller&lt;/TD&gt;&lt;TD&gt;153263&lt;/TD&gt;&lt;TD&gt;26276&lt;/TD&gt;&lt;TD&gt;m&lt;/TD&gt;&lt;TD&gt;2022-03-10 12:04:51&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;272327&lt;/TD&gt;&lt;TD&gt;Traveller&lt;/TD&gt;&lt;TD&gt;153263&lt;/TD&gt;&lt;TD&gt;26276&lt;/TD&gt;&lt;TD&gt;n&lt;/TD&gt;&lt;TD&gt;2022-03-10 12:04:55&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;272334&lt;/TD&gt;&lt;TD&gt;Agent&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;26276&lt;/TD&gt;&lt;TD&gt;o&lt;/TD&gt;&lt;TD&gt;2022-03-10 12:05:16&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sun, 24 Apr 2022 16:31:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-response-time-per/m-p/2473321#M67455</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-24T16:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the average of the response time per conversation ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-response-time-per/m-p/2473322#M67456</link>
      <description>&lt;P&gt;Hope this helps! Much thanks for helping me out! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2022 16:32:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-response-time-per/m-p/2473322#M67456</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-24T16:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the average of the response time per conversation ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-response-time-per/m-p/2473384#M67466</link>
      <description>&lt;P&gt;So in that case, what columns will you bring to the report ? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;Need to understand the filter context that will be applied in the measure.&lt;BR /&gt;Or the report (the table/matrix) actually contains all the columns from the data table you sent?&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2022 18:49:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-response-time-per/m-p/2473384#M67466</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-04-24T18:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the average of the response time per conversation ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-response-time-per/m-p/2473401#M67467</link>
      <description>&lt;P&gt;Hey, this is just how the report looks like for now. Super simple, without any filters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Later on, I would like a filter where I can select all the conversations on a Yearly and Monthy level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The tables I sent are now the only columns I need&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2022 19:34:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-average-of-the-response-time-per/m-p/2473401#M67467</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-24T19:34:44Z</dc:date>
    </item>
  </channel>
</rss>

