<?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: Wrong calculation of the average. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Wrong-calculation-of-the-average/m-p/3490334#M133611</link>
    <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="632976" data-lia-user-login="yayamiko1995" class="lia-mention lia-mention-user"&gt;yayamiko1995&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;According to your description, it seems like a common measure total level calculation issue, you can take a look at the following blog about measure total level calculations if helps:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907" target="_self"&gt;Measure Totals, The Final Word&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Xiaoxin Sheng&lt;/P&gt;</description>
    <pubDate>Mon, 23 Oct 2023 04:03:03 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-10-23T04:03:03Z</dc:date>
    <item>
      <title>Wrong calculation of the average.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Wrong-calculation-of-the-average/m-p/3483906#M133267</link>
      <description>&lt;P class=""&gt;Hi,&lt;/P&gt;&lt;P class=""&gt;I'm dealing with an issue when i'am trying to calculate the average.&lt;/P&gt;&lt;P class=""&gt;My datamodel is as follow.&lt;/P&gt;&lt;P class=""&gt;&lt;img /&gt;&lt;/P&gt;&lt;P class=""&gt;For technical reasons an order may have one or more lines of command.&lt;/P&gt;&lt;P class=""&gt;I' m trying to calculate the average of days before shipping of the orders.&lt;/P&gt;&lt;P class=""&gt;Mathematically speaking it should be : (15 + 3+ 7+ 21)/4 = 11.5&lt;/P&gt;&lt;P class=""&gt;But sadly powerbi calculate it wrongly:&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;img /&gt;&lt;/P&gt;&lt;P class=""&gt;I'm sure it is because of the lines of order but i don't know how to create a DAX ( i've tried but failed) measure in order to calculate it correctly.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;i tried the following:&lt;/P&gt;&lt;P class=""&gt;i creat a DAX measure&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;LI-CODE lang="markup"&gt;lol=sum(table[days before shipping)/countrows(table)&lt;/LI-CODE&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 class=""&gt;and&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;LI-CODE lang="markup"&gt;lol1=averagex(values(table[order number]),[lol]).&lt;/LI-CODE&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 class=""&gt;it gives me the right values but the result for each order behave badly ( the order number are different and therefore the days before shipping but it is the same issues i'm facing i just used different data):&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;img /&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;it is actually weird because i 'm a creating a table with the order number it goes well:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;img /&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;thanks in advance for your help&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 18 Oct 2023 17:28:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Wrong-calculation-of-the-average/m-p/3483906#M133267</guid>
      <dc:creator>yayamiko1995</dc:creator>
      <dc:date>2023-10-18T17:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong calculation of the average.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Wrong-calculation-of-the-average/m-p/3484676#M133310</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="632976" data-lia-user-login="yayamiko1995" class="lia-mention lia-mention-user"&gt;yayamiko1995&lt;/a&gt;&amp;nbsp;the Avgerage is&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ShippingDayAvg = AVERAGE(yayamiko1995[Day before shipping])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;You refer to dax guide for the basic calculations and function available in dax&lt;/P&gt;&lt;P&gt;&lt;A href="https://dax.guide/average/" target="_blank"&gt;AVERAGE - DAX Guide&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution!&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; Let me know if this work&lt;BR /&gt;@ me in replies, or I'll lose your thread!!!&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 05:25:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Wrong-calculation-of-the-average/m-p/3484676#M133310</guid>
      <dc:creator>DallasBaba</dc:creator>
      <dc:date>2023-10-19T05:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong calculation of the average.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Wrong-calculation-of-the-average/m-p/3485039#M133339</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="446607" data-lia-user-login="DallasBaba" class="lia-mention lia-mention-user"&gt;DallasBaba&lt;/a&gt;&amp;nbsp; thanks for your answer but i don't understand what you did.&lt;/P&gt;&lt;P&gt;it is pretty obvious that the average of 15,3,7,21 is (15+3+7+21)/4=11,5 and not at all 8.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 08:21:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Wrong-calculation-of-the-average/m-p/3485039#M133339</guid>
      <dc:creator>yayamiko1995_1</dc:creator>
      <dc:date>2023-10-19T08:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong calculation of the average.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Wrong-calculation-of-the-average/m-p/3485888#M133391</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="588640" data-lia-user-login="yayamiko1995_1" class="lia-mention lia-mention-user"&gt;yayamiko1995_1&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="632976" data-lia-user-login="yayamiko1995" class="lia-mention lia-mention-user"&gt;yayamiko1995&lt;/a&gt;&amp;nbsp;&lt;SPAN&gt;you right the average of 15,3,7,21 is (15+3+7+21)/4=11,5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;U&gt;Note&lt;/U&gt;: You can't ignore the repeated values when accounting for Class average, because&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;your dataset includes duplicates of 3 &amp;amp; 7 ---&amp;gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;15,3,&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;3,3,7&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;,7,21 is (15+3&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;+3+3+7&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;+7+21)/7=8.43 or 8&lt;/SPAN&gt;&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;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution!&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 15:44:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Wrong-calculation-of-the-average/m-p/3485888#M133391</guid>
      <dc:creator>DallasBaba</dc:creator>
      <dc:date>2023-10-19T15:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong calculation of the average.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Wrong-calculation-of-the-average/m-p/3490334#M133611</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="632976" data-lia-user-login="yayamiko1995" class="lia-mention lia-mention-user"&gt;yayamiko1995&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;According to your description, it seems like a common measure total level calculation issue, you can take a look at the following blog about measure total level calculations if helps:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907" target="_self"&gt;Measure Totals, The Final Word&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 04:03:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Wrong-calculation-of-the-average/m-p/3490334#M133611</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-23T04:03:03Z</dc:date>
    </item>
  </channel>
</rss>

