<?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 Averages Showing Wildly Incorrect Numbers in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Averages-Showing-Wildly-Incorrect-Numbers/m-p/3940744#M153213</link>
    <description>&lt;P&gt;I am trying to find the average pickup and dropoff times for each client in our center to compare to the scheduled pickup/dropoff times for analysis. I have tried this a few different ways but the averages I am getting are so far off from what they should be. Looking for any assistance. Currently I am using the following formula to find the average pickup time :&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;AveragePickUpTime =&lt;BR /&gt;AVERAGEX(&lt;BR /&gt;FILTER('Form Data', 'Form Data'[PickUpOrDropOff] = "PickUp"),&lt;BR /&gt;'Form Data'[Date]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;and this one for the column in the table&lt;/P&gt;&lt;P&gt;AveragePickUpColumn =&lt;BR /&gt;AVERAGEX(&lt;BR /&gt;FILTER('Form Data', 'Form Data'[PickUpOrDropOff] = "PickUp" &amp;amp;&amp;amp; 'Form Data'[Client] = 'Client Schedules'[Client Initials]),&lt;BR /&gt;'Form Data'[Date]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;I honestly got confused because there were a lot of conflicting tutorials and I got messed up along the way. All I want is the average pickup time per client and the average dropoff time per client. I would also like this data to be filterable. Please let me know if any additional screenshots&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For reference here is what the averages should be:&amp;nbsp;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 22 May 2024 19:48:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-05-22T19:48:58Z</dc:date>
    <item>
      <title>Averages Showing Wildly Incorrect Numbers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Averages-Showing-Wildly-Incorrect-Numbers/m-p/3940744#M153213</link>
      <description>&lt;P&gt;I am trying to find the average pickup and dropoff times for each client in our center to compare to the scheduled pickup/dropoff times for analysis. I have tried this a few different ways but the averages I am getting are so far off from what they should be. Looking for any assistance. Currently I am using the following formula to find the average pickup time :&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;AveragePickUpTime =&lt;BR /&gt;AVERAGEX(&lt;BR /&gt;FILTER('Form Data', 'Form Data'[PickUpOrDropOff] = "PickUp"),&lt;BR /&gt;'Form Data'[Date]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;and this one for the column in the table&lt;/P&gt;&lt;P&gt;AveragePickUpColumn =&lt;BR /&gt;AVERAGEX(&lt;BR /&gt;FILTER('Form Data', 'Form Data'[PickUpOrDropOff] = "PickUp" &amp;amp;&amp;amp; 'Form Data'[Client] = 'Client Schedules'[Client Initials]),&lt;BR /&gt;'Form Data'[Date]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;I honestly got confused because there were a lot of conflicting tutorials and I got messed up along the way. All I want is the average pickup time per client and the average dropoff time per client. I would also like this data to be filterable. Please let me know if any additional screenshots&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For reference here is what the averages should be:&amp;nbsp;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 19:48:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Averages-Showing-Wildly-Incorrect-Numbers/m-p/3940744#M153213</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-22T19:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Averages Showing Wildly Incorrect Numbers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Averages-Showing-Wildly-Incorrect-Numbers/m-p/3942389#M153265</link>
      <description>&lt;P&gt;Hi&amp;nbsp; Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created some data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I'm not very clear about what you mean by date average, whether it refers to the average of the minimum date and the maximum date (hh:mm:ss), if it's convenient, you can explain the logic of date average, we can help you better.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated column.&lt;/P&gt;
&lt;P&gt;If you want to get the average of the minimum and maximum dates after grouping (hh:mm:ss)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;AVG(hhmmss) =
var _mindate=
MINX(FILTER(ALL('Table'),'Table'[Group]=EARLIER('Table'[Group])),[Scheduled DropOff])
var _maxdate=
MAXX(FILTER(ALL('Table'),'Table'[Group]=EARLIER('Table'[Group])),[Scheduled DropOff])
var _second=
DATEDIFF(
    _mindate,_maxdate,SECOND)
var _count=
COUNTX(
  FILTER(ALL('Table'),'Table'[Group]=EARLIER('Table'[Group])),[Scheduled DropOff])
var _avg=
DIVIDE(
    _second,_count)
RETURN
TIME ( 0, 0, FLOOR ( _avg, 1 ) )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to get the average date between the minimum and maximum dates after grouping.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;AVG =
var _mindate=
MINX(FILTER(ALL('Table'),'Table'[Group]=EARLIER('Table'[Group])),[Scheduled DropOff])
RETURN
_mindate + [AVG(hhmmss)]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Set the data format as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;3. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 08:13:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Averages-Showing-Wildly-Incorrect-Numbers/m-p/3942389#M153265</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-23T08:13:07Z</dc:date>
    </item>
  </channel>
</rss>

