<?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: Average and Median Time and filtering by another columns value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-and-Median-Time-and-filtering-by-another-columns-value/m-p/4692185#M179674</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1241345" data-lia-user-login="mhesli" class="lia-mention lia-mention-user"&gt;mhesli&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;I wanted to check if you had the opportunity to review the information provided by &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="501067" data-lia-user-login="Sahir_Maharaj" class="lia-mention lia-mention-user"&gt;Sahir_Maharaj&lt;/a&gt;&amp;nbsp;. Please feel free to contact us if you have any further questions. If his response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.&lt;BR /&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 14 May 2025 09:25:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-05-14T09:25:57Z</dc:date>
    <item>
      <title>Average and Median Time and filtering by another columns value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-and-Median-Time-and-filtering-by-another-columns-value/m-p/4615168#M176620</link>
      <description>&lt;P&gt;Good morning,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I am trying to find the average and median time of a customer’s arrival to different points of their visit and have it filter the result to only include two types of visit reasons.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the following formulas&lt;/P&gt;&lt;P&gt;Door to Purchase =&amp;nbsp;'Door to purchase'[Purchase date time]-'Door to purchase'[Customer arrival date time]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Door to Purchase in seconds = HOUR('Door to purchase'[Door to purchase])*3600+ MINUTE('Door to purchase'[Door to purchase])*60+SECOND('Door to purchase'[Door to purchase])*1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Average Duration Arrival to Purchase hh:nn:ss = FORMAT(AVERAGE('Door to purchase'[Door to Purchase in seconds]), 'hh:nn:ss")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This gives me the average time duration but I need to further filter it by reason for purchase.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have these columns available&lt;/P&gt;&lt;P&gt;CAL reason for purchase Birthday = CALCULATE(COUNTROWS('Door to purchase'), CONSTAINSSTRING('Door to purchase'[Reason], "Birthday"))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CAL reason for purchase Wedding = CALCULATE(COUNTROWS('Door to purchase'), CONSTAINSSTRING('Door to purchase'[Reason}, "Wedding"))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reason for Purchase is Birthday or Wedding =&amp;nbsp;'Door to purchase [CAL reason for purchase Birthday] +'Door to purchase [CAL reason for purchase Wedding]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question 1 How do I find the average times filtering only customers with a purchase reason of Birthday or Wedding?&lt;/P&gt;&lt;P&gt;Question 2&amp;nbsp;How do I find the Median times filtering only customers with a purchase reason of Birthday or Wedding?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated!&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;&lt;P&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;&lt;P&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>Tue, 18 Mar 2025 18:16:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-and-Median-Time-and-filtering-by-another-columns-value/m-p/4615168#M176620</guid>
      <dc:creator>mhesli</dc:creator>
      <dc:date>2025-03-18T18:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Average and Median Time and filtering by another columns value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-and-Median-Time-and-filtering-by-another-columns-value/m-p/4615380#M176629</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;Do not include sensitive information. Do not include anything that is unrelated to the issue or question. &lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Need help uploading data? &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 21:52:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-and-Median-Time-and-filtering-by-another-columns-value/m-p/4615380#M176629</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-03-18T21:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Average and Median Time and filtering by another columns value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-and-Median-Time-and-filtering-by-another-columns-value/m-p/4652007#M178070</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1241345" data-lia-user-login="mhesli" class="lia-mention lia-mention-user"&gt;mhesli&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Thank you for reaching out microsoft fabric community forum.&lt;BR /&gt;As mentioned by &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;Could you please provide sample data so that we can assist you more efficiently?.&lt;BR /&gt;Thankyou.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 15:21:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-and-Median-Time-and-filtering-by-another-columns-value/m-p/4652007#M178070</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-04-14T15:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Average and Median Time and filtering by another columns value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-and-Median-Time-and-filtering-by-another-columns-value/m-p/4652389#M178095</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1241345" data-lia-user-login="mhesli" class="lia-mention lia-mention-user"&gt;mhesli&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please try this approach:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Question 1&lt;/LI&gt;
&lt;/UL&gt;
&lt;LI-CODE lang="markup"&gt;Door to Purchase (Seconds) =
DATEDIFF(
    'Door to purchase'[Customer arrival date time],
    'Door to purchase'[Purchase date time],
    SECOND
)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Avg Arrival to Purchase (Birthday/Wedding) =
CALCULATE (
    AVERAGE('Door to purchase'[Door to Purchase (Seconds)]),
    FILTER (
        'Door to purchase',
        CONTAINSSTRING('Door to purchase'[Reason], "Birthday")
        || CONTAINSSTRING('Door to purchase'[Reason], "Wedding")
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Question 2&lt;/LI&gt;
&lt;/UL&gt;
&lt;LI-CODE lang="markup"&gt;Median Arrival to Purchase (Birthday/Wedding) =
MEDIANX (
    FILTER (
        'Door to purchase',
        CONTAINSSTRING('Door to purchase'[Reason], "Birthday")
        || CONTAINSSTRING('Door to purchase'[Reason], "Wedding")
    ),
    'Door to purchase'[Door to Purchase (Seconds)]
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If possible,&amp;nbsp;it would be great if you could you please provide sample data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 19:21:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-and-Median-Time-and-filtering-by-another-columns-value/m-p/4652389#M178095</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2025-04-14T19:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Average and Median Time and filtering by another columns value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-and-Median-Time-and-filtering-by-another-columns-value/m-p/4686137#M179486</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1241345" data-lia-user-login="mhesli" class="lia-mention lia-mention-user"&gt;mhesli&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2025 07:26:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-and-Median-Time-and-filtering-by-another-columns-value/m-p/4686137#M179486</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-09T07:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Average and Median Time and filtering by another columns value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-and-Median-Time-and-filtering-by-another-columns-value/m-p/4692185#M179674</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1241345" data-lia-user-login="mhesli" class="lia-mention lia-mention-user"&gt;mhesli&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;I wanted to check if you had the opportunity to review the information provided by &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="501067" data-lia-user-login="Sahir_Maharaj" class="lia-mention lia-mention-user"&gt;Sahir_Maharaj&lt;/a&gt;&amp;nbsp;. Please feel free to contact us if you have any further questions. If his response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.&lt;BR /&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 09:25:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-and-Median-Time-and-filtering-by-another-columns-value/m-p/4692185#M179674</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-14T09:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Average and Median Time and filtering by another columns value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-and-Median-Time-and-filtering-by-another-columns-value/m-p/4718201#M180706</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1241345" data-lia-user-login="mhesli" class="lia-mention lia-mention-user"&gt;mhesli&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please &lt;STRONG&gt;Accept it as a solution&lt;/STRONG&gt; and give it a '&lt;STRONG&gt;Kudos&lt;/STRONG&gt;' so others can find it easily.&lt;BR /&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 10:41:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-and-Median-Time-and-filtering-by-another-columns-value/m-p/4718201#M180706</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-06-03T10:41:49Z</dc:date>
    </item>
  </channel>
</rss>

