<?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: Calculating Average of a measure within a hierarchy in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Average-of-a-measure-within-a-hierarchy/m-p/3769270#M147211</link>
    <description>&lt;P&gt;Hi! So you would recommend me to create a measure that includes the calculation on Score1 and also the average of that score to get the score for the regions? I assume I would need to create temporary tables. If we assume that the calculation of score1 inside of that measure is VAR Score1= [Price] * [Units] , how would I calculate the average for each region?&lt;/P&gt;</description>
    <pubDate>Sun, 17 Mar 2024 10:18:48 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-03-17T10:18:48Z</dc:date>
    <item>
      <title>Calculating Average of a measure within a hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Average-of-a-measure-within-a-hierarchy/m-p/3768871#M147174</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to solve an issue that I am having with DAX, but I cant find the right query.&lt;BR /&gt;To give you some context: I have different regions in my data that have the values T100, T200, T300 and so on. They can be found in the column RegionLevel2 in the table Geography. Then , in the same table there is a column called TerrLevel1 that has the territories. Each region has multiple territories. So for example the territories for region T100, are T101, T102, T103 and so on. For each of these territories I have calculated a Score, based on their individual sales. It is a measure called Score1 and working fine. Now I need to calculate the score for the regions. This score is based on the average of the sales of a regions territories. So in the case of T100, its score would be the average of the Score1 of T101, T102, T103 and so on. I have tried these DAX&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AVERAGEX&lt;/SPAN&gt;&lt;SPAN&gt;(Geography&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[Score1]&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;AVERAGEX(all(Geography[TerrLevel1]), [Score1])&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;AVERAGEX(VALUES(Geography[TerrLevel1]), [Score1])&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;AVERAGEX&lt;/SPAN&gt;&lt;SPAN&gt;(Geography, [Score1]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(Geography[TerrLevel1]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;but it is not giving me the right result. I guess i need to filter somehow to group the right territories with their region but I cant figure out how.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I would appreciate any kind of help. Thank!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 16 Mar 2024 17:14:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Average-of-a-measure-within-a-hierarchy/m-p/3768871#M147174</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-16T17:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Average of a measure within a hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Average-of-a-measure-within-a-hierarchy/m-p/3768935#M147176</link>
      <description>&lt;P&gt;You cannot measure a measure.&amp;nbsp; Either materialize it, or create a new measure that implements the entire business logic.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Mar 2024 18:01:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Average-of-a-measure-within-a-hierarchy/m-p/3768935#M147176</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-16T18:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Average of a measure within a hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Average-of-a-measure-within-a-hierarchy/m-p/3769270#M147211</link>
      <description>&lt;P&gt;Hi! So you would recommend me to create a measure that includes the calculation on Score1 and also the average of that score to get the score for the regions? I assume I would need to create temporary tables. If we assume that the calculation of score1 inside of that measure is VAR Score1= [Price] * [Units] , how would I calculate the average for each region?&lt;/P&gt;</description>
      <pubDate>Sun, 17 Mar 2024 10:18:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Average-of-a-measure-within-a-hierarchy/m-p/3769270#M147211</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-17T10:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Average of a measure within a hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Average-of-a-measure-within-a-hierarchy/m-p/3769546#M147222</link>
      <description>&lt;P&gt;Here's the pseudo code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SUMMARIZECOLUMNS(Region)&lt;/P&gt;
&lt;P&gt;ADDCOLUMNS(score measure)&lt;/P&gt;
&lt;P&gt;Return AVERAGEX&lt;/P&gt;</description>
      <pubDate>Sun, 17 Mar 2024 19:37:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Average-of-a-measure-within-a-hierarchy/m-p/3769546#M147222</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-17T19:37:45Z</dc:date>
    </item>
  </channel>
</rss>

