<?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: How to find the average in the group in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340893#M23948</link>
    <description>Mate, you're missing context transition under AVERAGEX. A measure is not the same as putting COUNT(something). A measure is ALWAYS implicitly wrapped in CALCULATE. Since you're not using a measure under AVERAGEX, you have to wrap this expression into CALCULATE yourself.</description>
    <pubDate>Wed, 02 Sep 2020 10:23:40 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-09-02T10:23:40Z</dc:date>
    <item>
      <title>How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339888#M23902</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;i want the average in the form&lt;/P&gt;&lt;P&gt;eg: cellular Therapy (39+15+4)/3(Years)&lt;/P&gt;&lt;P&gt;Can anyone help me out with this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 03:12:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339888#M23902</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-02T03:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339924#M23905</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , &lt;/P&gt;
&lt;P&gt;calculate([AvgSgdGroupMeasure], allexpect(table,Table[SdgStudygroup]))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 03:25:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339924#M23905</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-09-02T03:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339934#M23906</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;- Perhaps:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
  VAR __Group = MAX([sdgStudyGroup])
  VAR __Average = AVERAGEX(FILTER(ALL('Table'),[sdgStudyGroup]=__Group),[Count of vw_AccrualsListPatientID])
RETURN
  __Average&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 02 Sep 2020 03:27:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339934#M23906</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-09-02T03:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339950#M23907</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It did not work&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 03:33:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339950#M23907</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-02T03:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339957#M23908</link>
      <description>&lt;P&gt;sorry did not work&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 03:35:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339957#M23908</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-02T03:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339960#M23909</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;- Oh, I think I see what is going on, it is a measure aggregation issue.&amp;nbsp;This looks like a measure aggregation problem. See my blog article about that here: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The pattern is: &lt;BR /&gt;MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])&lt;BR /&gt;MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])&lt;BR /&gt;AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])&lt;BR /&gt;etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So probably something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  VAR __Group = MAX([sdgStudyGroup])
  VAR __Table = SUMMARIZE(FILTER(ALL('Table'),[sdgStudyGroup] = __Group),[Year],"Count",[vw_AccrualsListPatientID])
RETURN
  AVERAGEX(__Table,[vw_AccrualsListPatientID)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 03:40:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339960#M23909</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-09-02T03:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339969#M23910</link>
      <description>&lt;P&gt;Yes I want to find the average of the [&lt;SPAN&gt;Count of..&lt;/SPAN&gt;]&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 03:39:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339969#M23910</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-02T03:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339972#M23911</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Oh, I think I see what is going on, it is a measure aggregation issue.&amp;nbsp;This looks like a measure aggregation problem. See my blog article about that here:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The pattern is:&lt;BR /&gt;MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])&lt;BR /&gt;MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])&lt;BR /&gt;AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])&lt;BR /&gt;etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So probably something like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  VAR __Group = MAX([sdgStudyGroup])
  VAR __Table = SUMMARIZE(FILTER(ALL('Table'),[sdgStudyGroup] = __Group),[Year],"Count",COUNT([vw_AccrualsListPatientID]))
RETURN
  AVERAGEX(__Table,[Count])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is why you should always post sample source data because it is hard to tell exactly what things are in images. Please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The most important parts are:&lt;BR /&gt;1. Sample data as text, use the table tool in the editing bar&lt;BR /&gt;2. Expected output from sample data&lt;BR /&gt;3. Explanation in words of how to get from 1. to 2.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 03:42:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339972#M23911</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-09-02T03:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339981#M23913</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;It says i cannot find the name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 03:45:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339981#M23913</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-02T03:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339985#M23914</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  VAR __Group = MAX([sdgStudyGroup])
  VAR __Table = SUMMARIZE(FILTER(ALL('Table'),[sdgStudyGroup] = __Group),[Year],"Count",COUNT([vw_AccrualsListPatientID]))
RETURN
  AVERAGEX(__Table,[Count])&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 02 Sep 2020 03:46:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339985#M23914</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-09-02T03:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339996#M23915</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it gives me all the columns not the filtered one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 03:50:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1339996#M23915</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-02T03:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340023#M23916</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;- Dude, seriously, you need to include more details in your post if you want to get a valid answer.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  VAR __Group = MAX([sdgStudyGroup])
  VAR __Table = SUMMARIZE(FILTER(ALLEXCEPT('Table',[Year]),[sdgStudyGroup] = __Group),[Year],"Count",COUNT([vw_AccrualsListPatientID]))
RETURN
  AVERAGEX(__Table,[Count])&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 02 Sep 2020 04:05:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340023#M23916</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-09-02T04:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340822#M23939</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;[Within-Group Avg over Years] =
// T is the name of the table;
// This measure will return
// a number if only one group is
// visible in the current context.
var __currentGroup = selectedvalue( T[StudyGroup] )
var __result =
    calculate(
        averagex(
            values( T[Year] ),
            [AVGSdgGroupMeasure]
        ),
        T[StudyGroup] = __currentGroup,
        // This directive makes it
        // a visual calculation.
        allselected( T )
    )
return
    __result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 09:55:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340822#M23939</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-02T09:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340852#M23942</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Gives me error&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 10:03:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340852#M23942</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-02T10:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340877#M23944</link>
      <description>Yeah... If you start reading the error messages, they will help you diagnose problems.</description>
      <pubDate>Wed, 02 Sep 2020 10:14:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340877#M23944</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-02T10:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340889#M23946</link>
      <description>&lt;P&gt;it says&lt;/P&gt;&lt;P&gt;"The value for 'Year' cannot be determined. Either the column doesn't exist, or there is no current row for this column."&lt;/P&gt;&lt;P&gt;I tried putting the actual year column it worked! thank you.&lt;/P&gt;&lt;P&gt;But I am getting the sum of the columns not the average&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;it should be 58/3(no. of years) for the first group. Please let me know if I am doing anything wrong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 10:21:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340889#M23946</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-02T10:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340890#M23947</link>
      <description>You have to be able to say VALUES( T[Year] ). I don't know how you obtain this field from your table but you have to be able to do it for the formula to work.</description>
      <pubDate>Wed, 02 Sep 2020 10:21:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340890#M23947</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-02T10:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340893#M23948</link>
      <description>Mate, you're missing context transition under AVERAGEX. A measure is not the same as putting COUNT(something). A measure is ALWAYS implicitly wrapped in CALCULATE. Since you're not using a measure under AVERAGEX, you have to wrap this expression into CALCULATE yourself.</description>
      <pubDate>Wed, 02 Sep 2020 10:23:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340893#M23948</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-02T10:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340899#M23949</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Worked! I learned something new today. Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 10:26:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340899#M23949</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-02T10:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the average in the group</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340909#M23951</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;Here's a piece of the best advice you can get about PowerBI and DAXing:&lt;BR /&gt;&lt;BR /&gt;As soon as you can, please get yourself the book "The Definitive Guide to DAX" by Marco Russo and Alberto Ferrari and read it as fast as you can. You'll have to read it several times over so start as soon as you can.&lt;BR /&gt;&lt;BR /&gt;This IS simply the best advice you've ever heard/read from a human being about mastering PowerBI, even though you might think at this very moment that I'm out of my mind.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 10:33:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-the-average-in-the-group/m-p/1340909#M23951</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-02T10:33:19Z</dc:date>
    </item>
  </channel>
</rss>

