<?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: Challenge with SUM of AVERAGES in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Challenge-with-SUM-of-AVERAGES/m-p/1516761#M29534</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , also use isinscope &lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/" target="_blank"&gt;https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 15:31:17 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2020-11-25T15:31:17Z</dc:date>
    <item>
      <title>Challenge with SUM of AVERAGES</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Challenge-with-SUM-of-AVERAGES/m-p/1516639#M29524</link>
      <description>&lt;P&gt;Hello PBI Community!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I have a challenge with DAX. My end-users want to see AVERAGE of products sold for each weekday but the Grand Total should be a SUM of these AVERAGES. I wrote some DAX:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my code looks like that:&lt;/P&gt;&lt;PRE&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;sumOfAverages = &lt;BR /&gt;VAR avgFull =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM ( [sold_qt] )&lt;BR /&gt;/ DISTINCTCOUNT ( [delivery_date] )&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;IF (&lt;BR /&gt;HASONEVALUE ( [weekday_name] ),&lt;BR /&gt;avgFull,&lt;BR /&gt;SUMX ( VALUES ( date_weekday_dim[weekday_name] ), avgFull )&lt;BR /&gt;)&lt;/PRE&gt;&lt;P&gt;Actually it's working only if I have selected all the weekdays. See the screen below.&lt;img /&gt;&amp;nbsp; If I select something on slicers and there won't be any data from particular weekday it looks like that.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;So the Grand Total is not correct. I think that there's a problem with SUMX (VALUES ... )) section in DAX but really don't know how to figure it out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you help me with this, please?:)&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 14:33:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Challenge-with-SUM-of-AVERAGES/m-p/1516639#M29524</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T14:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Challenge with SUM of AVERAGES</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Challenge-with-SUM-of-AVERAGES/m-p/1516737#M29529</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;BR /&gt;Created a table, then on visuals a slicer, and a matrix, then a measure.&lt;/P&gt;
&lt;P&gt;&lt;img /&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;LI-CODE lang="markup"&gt;Sum of Daily Averages = SUMX(DailyAverages,Divide(DailyAverages[Sold],DailyAverages[DistinctCount]))&lt;/LI-CODE&gt;
&lt;P&gt;This should work if I understand your issue.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Let me know if you have any questions.&lt;BR /&gt;&lt;BR /&gt;If this solves your issues, please mark it as the &lt;STRONG&gt;solution, &lt;/STRONG&gt;so that others can find it easily. &lt;STRONG&gt;Kudos &lt;/STRONG&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;are nice too.&lt;BR /&gt;Nathaniel&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 15:24:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Challenge-with-SUM-of-AVERAGES/m-p/1516737#M29529</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2020-11-25T15:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Challenge with SUM of AVERAGES</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Challenge-with-SUM-of-AVERAGES/m-p/1516754#M29532</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;If one of the days has no values...&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;Let me know if you have any questions.&lt;BR /&gt;&lt;BR /&gt;If this solves your issues, please mark it as the &lt;STRONG&gt;solution, &lt;/STRONG&gt;so that others can find it easily. &lt;STRONG&gt;Kudos &lt;/STRONG&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;are nice too.&lt;BR /&gt;Nathaniel&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 15:26:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Challenge-with-SUM-of-AVERAGES/m-p/1516754#M29532</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2020-11-25T15:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Challenge with SUM of AVERAGES</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Challenge-with-SUM-of-AVERAGES/m-p/1516761#M29534</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , also use isinscope &lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/" target="_blank"&gt;https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 15:31:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Challenge-with-SUM-of-AVERAGES/m-p/1516761#M29534</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-11-25T15:31:17Z</dc:date>
    </item>
  </channel>
</rss>

