<?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: calculate averages with null values? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2361851#M60385</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Look at my page 1. It works here. Thanks&lt;/P&gt;&lt;P&gt;&lt;A title="Avg Question" href="https://drive.google.com/file/d/1gElEdPCYwG6Xv_pc_xlWGkdKLC3dsrY5/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1gElEdPCYwG6Xv_pc_xlWGkdKLC3dsrY5/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Feb 2022 20:20:51 GMT</pubDate>
    <dc:creator>Whitewater100</dc:creator>
    <dc:date>2022-02-25T20:20:51Z</dc:date>
    <item>
      <title>calculate averages with null values?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2360995#M60341</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;i want to analyze my shops average cart combination.&lt;/P&gt;&lt;P&gt;therefore i have clustered my products in main categories and put them in a matrix. e.g.:&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 order 1 someone bought 1 x 4kg product and&amp;nbsp;&lt;/P&gt;&lt;P&gt;in order 2 someone bought 6x Probe.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so far so good.&lt;/P&gt;&lt;P&gt;In the sum line instead of&lt;/P&gt;&lt;P&gt;1 ; 6 ; 7&lt;/P&gt;&lt;P&gt;i would like to see&lt;/P&gt;&lt;P&gt;0,5; 3; 3,5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;because it is the average bought.&lt;/P&gt;&lt;P&gt;when i create a DAX now:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;AVG =  DIVIDE(SUM('Order'[Qty]), DISTINCTCOUNT('Order'[OrderNbr])) &lt;/LI-CODE&gt;&lt;P&gt;i get this:&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the totals average is fine, but the individual columns not.&amp;nbsp;&lt;/P&gt;&lt;P&gt;i guess when QTY = null the DISTINCTCOUNT does not work. ...&lt;/P&gt;&lt;P&gt;any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 11:14:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2360995#M60341</guid>
      <dc:creator>elenio</dc:creator>
      <dc:date>2022-02-25T11:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: calculate averages with null values?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2361046#M60346</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Try something like this:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure 19 = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;isblank&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table (7)'[Column3]&lt;/SPAN&gt;&lt;SPAN&gt;)),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;divide&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table (7)'[Column2]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;all&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table (7)'[Column3]&lt;/SPAN&gt;&lt;SPAN&gt;))))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table (7)'[Column2]&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;Here I use SELECTEDVALUE to indentify total row and use a separete logic there. For the rest of the rows I simply use the "order value".&lt;BR /&gt;&lt;BR /&gt;I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!&lt;BR /&gt;&lt;BR /&gt;My LinkedIn: &lt;A href="https://www.linkedin.com/in/n%C3%A4ttiahov-00001/" target="_blank"&gt;https://www.linkedin.com/in/n%C3%A4ttiahov-00001/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 11:41:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2361046#M60346</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2022-02-25T11:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: calculate averages with null values?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2361120#M60351</link>
      <description>&lt;P&gt;hi there,&lt;/P&gt;&lt;P&gt;looking at your Column A sum, your solution is not correct:&lt;/P&gt;&lt;P&gt;(100+300)/7 = 57,1 and not 50&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thx&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 12:28:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2361120#M60351</guid>
      <dc:creator>elenio</dc:creator>
      <dc:date>2022-02-25T12:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: calculate averages with null values?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2361402#M60365</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;Perhaps one alternative:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Avg Amt = &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;NOT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ISFILTERED&lt;/SPAN&gt;&lt;SPAN&gt;(Order&lt;/SPAN&gt;&lt;SPAN&gt;[Order#]&lt;/SPAN&gt;&lt;SPAN&gt;)), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(Order&lt;/SPAN&gt;&lt;SPAN&gt;[Qty]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(Order&lt;/SPAN&gt;&lt;SPAN&gt;))))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Feb 2022 14:43:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2361402#M60365</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-02-25T14:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: calculate averages with null values?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2361796#M60384</link>
      <description>&lt;P&gt;this just returns null &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 19:06:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2361796#M60384</guid>
      <dc:creator>elenio</dc:creator>
      <dc:date>2022-02-25T19:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: calculate averages with null values?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2361851#M60385</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Look at my page 1. It works here. Thanks&lt;/P&gt;&lt;P&gt;&lt;A title="Avg Question" href="https://drive.google.com/file/d/1gElEdPCYwG6Xv_pc_xlWGkdKLC3dsrY5/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1gElEdPCYwG6Xv_pc_xlWGkdKLC3dsrY5/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 20:20:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2361851#M60385</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-02-25T20:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: calculate averages with null values?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2361969#M60392</link>
      <description>&lt;P&gt;The "averages" you want don't really make sense as averages, IMO. There's only one 4kg order, so the average is simply 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really do want to average over non-existent orders too, then I strongly recommend creating a dimension table for your orders so you don't have to fight against &lt;A href="https://www.sqlbi.com/articles/understanding-dax-auto-exist/" target="_blank"&gt;auto-exists&lt;/A&gt;. With a dimension table, it becomes much easier to write formulas for combinations that don't necessarily exist in your fact table.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 22:05:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2361969#M60392</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-02-25T22:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: calculate averages with null values?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2363101#M60450</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;Did you look at the file I shared last time?&lt;/P&gt;&lt;P&gt;On Page 1 the results are:&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;</description>
      <pubDate>Sun, 27 Feb 2022 19:03:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2363101#M60450</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-02-27T19:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: calculate averages with null values?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2364178#M60491</link>
      <description>&lt;P&gt;Hi Thanks,&lt;/P&gt;&lt;P&gt;still trying to figure out, why it is not working with my data. but yours seems to work fine &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THANKS!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 09:27:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2364178#M60491</guid>
      <dc:creator>elenio</dc:creator>
      <dc:date>2022-02-28T09:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: calculate averages with null values?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2364194#M60492</link>
      <description>&lt;P&gt;ok. i had a filter on a set of order# to check the solution. if i filter in your example, it also returns nulls.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 09:33:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2364194#M60492</guid>
      <dc:creator>elenio</dc:creator>
      <dc:date>2022-02-28T09:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: calculate averages with null values?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2365045#M60524</link>
      <description>&lt;P&gt;You can add this measure to the file posted:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Avg Amt Filtered = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;AvgTable[Qty]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;AvgTable&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 28 Feb 2022 15:53:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-averages-with-null-values/m-p/2365045#M60524</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-02-28T15:53:34Z</dc:date>
    </item>
  </channel>
</rss>

