<?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: Average of group not showing correctly in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4337282#M172216</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;- please provide the DAX you have already used.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Dec 2024 15:46:38 GMT</pubDate>
    <dc:creator>mark_endicott</dc:creator>
    <dc:date>2024-12-19T15:46:38Z</dc:date>
    <item>
      <title>Average of group not showing correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4337142#M172209</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having some trouble with a calculation here as the "total" in the below visual does not represent the average of what is presented, which is what I would like. Essentially I would like to take an average of what is in the "Consumer Preference Score" column and divide each consumer preference score by that average to get the "Consumer Preference Index". As you can see, right now it does not look like it's being calculated correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance would be appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Maggie&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>Thu, 19 Dec 2024 14:30:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4337142#M172209</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-19T14:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Average of group not showing correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4337282#M172216</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;- please provide the DAX you have already used.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 15:46:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4337282#M172216</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-12-19T15:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Average of group not showing correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4338879#M172293</link>
      <description>&lt;P&gt;Yes, so Consumer Preference Score is this:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Consumer Preference Score =&lt;/SPAN&gt; &lt;SPAN&gt;[Industry Per Caps Rank]&lt;/SPAN&gt;&lt;SPAN&gt;+&lt;/SPAN&gt;&lt;SPAN&gt;[Observed Drinkers Rank] -- as you can see it's the addition of two rank figures.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The Average Consumer Preference Score is this:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Avg&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt; Consumer Preference Score =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;[Consumer Preference Score]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Nielsen (excl dist)'&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 20 Dec 2024 14:43:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4338879#M172293</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-20T14:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Average of group not showing correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4338895#M172296</link>
      <description>&lt;P&gt;Ok, if you want an average of the scores in the visual you should use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;AVERAGEX( ALLSELECTED('Nielsen (excl dist)'), [Consumer Preference Score])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this works, please accept as the solution.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2024 14:53:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4338895#M172296</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-12-20T14:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Average of group not showing correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4340731#M172367</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;- did we resolve your issue? If we did, please select the appropriate solution, it helps with visibility for others and for SuperUsers to keep their status! Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2024 10:55:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4340731#M172367</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-12-23T10:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Average of group not showing correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4343747#M172476</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343036" data-lia-user-login="mark_endicott" class="lia-mention lia-mention-user"&gt;mark_endicott&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much for getting back to me. It looks like when I take this approach I get the following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In this instance, I would expect the average to be ~16. The sub-category column being used comes from a parameter. Any help would be appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2024 14:27:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4343747#M172476</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-26T14:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Average of group not showing correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4343813#M172479</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please try with the next options:&lt;BR /&gt;--&amp;gt;Please change in the 1st code "TransactionTable" with the name of your transactionTable&lt;BR /&gt;To calculated the average of the subcaategories including the total please use the next measure:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Avg. Consumer Preference Score :=
AVERAGEX(
    VALUES( 'Nielsen (excl dist)' ),
    CALCULATE(
        AVERAGEX(
            TransactionTable, //please place here your transactionTable
            [Consumer Preference Score]
        )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;If you want to have all the selected one please use this measure:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MeasureALLSELECTED =
CALCULATE(
    [Avg. Consumer Preference Score],
    ALLSELECTED( 'Nielsen (excl dist)' )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;and if you want to have all the subcategories no matter if they are selected please use this measure:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MeasureALL =
CALCULATE(
    [Avg. Consumer Preference Score],
    ALL( 'Nielsen (excl dist)' )
)&lt;/LI-CODE&gt;&lt;P&gt;I hope this help if so pleace mark as a solution. kudos are welcome&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2024 15:56:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4343813#M172479</guid>
      <dc:creator>pcoley</dc:creator>
      <dc:date>2024-12-26T15:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Average of group not showing correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4344680#M172523</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="842490" data-lia-user-login="pcoley" class="lia-mention lia-mention-user"&gt;pcoley&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your input. With this solution I get the following (see screenshot). The average figure I would expect would be 16.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2024 13:53:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4344680#M172523</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-27T13:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Average of group not showing correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4344693#M172528</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;We don´t know much about your model and the context where the measure is executed.&lt;BR /&gt;Therefore it´s very hard to develop a measure that works with your model and report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you share the pbix?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2024 14:25:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4344693#M172528</guid>
      <dc:creator>pcoley</dc:creator>
      <dc:date>2024-12-27T14:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Average of group not showing correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4346336#M172608</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="842490" data-lia-user-login="pcoley" class="lia-mention lia-mention-user"&gt;pcoley&lt;/a&gt;&amp;nbsp;- completely understand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the PBIX:&amp;nbsp;&lt;A href="https://drive.google.com/file/d/1MEiWn62BLC5gDQNDsg0Ti3UyQ26WP2zA/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1MEiWn62BLC5gDQNDsg0Ti3UyQ26WP2zA/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if you have any issues with access. Thanks! Maggie&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 15:04:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4346336#M172608</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-30T15:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Average of group not showing correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4346498#M172616</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try with this measure:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Avg. Consumer Preference Score = 
SWITCH(values('Field Select Parameter'[Selection Parameter Order]),
0 ,CALCULATE ([Consumer Preference Score], ALLSELECTED('Product Hierarchy'[Category])),
1,CALCULATE ([Consumer Preference Score], ALLSELECTED('Product Hierarchy'[Sub-Category])))&lt;/LI-CODE&gt;&lt;P&gt;I hope this helps, if so please accept the solution.&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":backhand_index_pointing_right:"&gt;👉&lt;/span&gt;kudos are welcome&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 19:10:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4346498#M172616</guid>
      <dc:creator>pcoley</dc:creator>
      <dc:date>2024-12-30T19:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Average of group not showing correctly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4347051#M172647</link>
      <description>&lt;P&gt;Hi all,thanks for the quick reply, I'll add more.&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Try this&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
VAR _selection = SELECTEDVALUE('Field Select Parameter'[Type])
VAR _table1 = ADDCOLUMNS(ALL('Product Hierarchy'[Category]),"Result",[Consumer Preference Score])
VAR _table2 = ADDCOLUMNS(ALL('Product Hierarchy'[Sub-Category]),"Result",[Consumer Preference Score])
RETURN
SWITCH(TRUE(),
_selection = "Category",DIVIDE([Consumer Preference Score],AVERAGEX(_table1,[Result])),
_selection = "Sub-Category",DIVIDE([Consumer Preference Score],AVERAGEX(_table2,[Result]))
)&lt;/LI-CODE&gt;
&lt;P&gt;Final output&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&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;</description>
      <pubDate>Tue, 31 Dec 2024 08:01:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-of-group-not-showing-correctly/m-p/4347051#M172647</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-31T08:01:55Z</dc:date>
    </item>
  </channel>
</rss>

