<?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: Creating Average measures for table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Average-measures-for-table/m-p/4033159#M159642</link>
    <description>&lt;P&gt;First aggregate at the level you need for your business logic, then use AVERAGEX. If event is the granularity you want to average at, try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;Event Avg Count =
VAR __Events =
    SUMMARIZE (
        AllSeatsData,
        AllSeatsData[Event Instance ID],
        "@Count", COUNTA ( AllSeatsData[Price] )
    )
RETURN
    AVERAGEX ( __Events, [@Count] )&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 09 Jul 2024 19:47:47 GMT</pubDate>
    <dc:creator>AlexisOlson</dc:creator>
    <dc:date>2024-07-09T19:47:47Z</dc:date>
    <item>
      <title>Creating Average measures for table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Average-measures-for-table/m-p/4033061#M159636</link>
      <description>&lt;P&gt;I have a table of ticket sales for different events, each row is a seat. If the seat is still available the "Price" column is empty. I have created a couple of measures that give me the number of ticket sales and the total renevue that will then repond to the filter context I am currently using. However I wish to create an average #sales and average revenue per event for the context.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My measures are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Sales = COUNT(AllSeatsData[Price])
Total Revenue = SUM(AllSeatsData[Price])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is some samples of my table:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hence if my filter context has only the two above events in it, I am looking for measure that gives me the average of SUM([Price]) and one that gives me the average of COUNT([Price]). E.g. if the data above were the only rows in the table for these events, the average of #sales should be 9 (event 39001 has 6 sales, event 45201 has 12, average of 6 &amp;amp; 12 is 9).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sure this is quite easy but I can't get my head around the maniputation of the context.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIA.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 18:00:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Average-measures-for-table/m-p/4033061#M159636</guid>
      <dc:creator>mbowler</dc:creator>
      <dc:date>2024-07-09T18:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Average measures for table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Average-measures-for-table/m-p/4033159#M159642</link>
      <description>&lt;P&gt;First aggregate at the level you need for your business logic, then use AVERAGEX. If event is the granularity you want to average at, try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;Event Avg Count =
VAR __Events =
    SUMMARIZE (
        AllSeatsData,
        AllSeatsData[Event Instance ID],
        "@Count", COUNTA ( AllSeatsData[Price] )
    )
RETURN
    AVERAGEX ( __Events, [@Count] )&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 09 Jul 2024 19:47:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Average-measures-for-table/m-p/4033159#M159642</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2024-07-09T19:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Average measures for table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Average-measures-for-table/m-p/4041958#M160271</link>
      <description>&lt;P&gt;Brilliant, that works great. Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 07:45:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-Average-measures-for-table/m-p/4041958#M160271</guid>
      <dc:creator>mbowler</dc:creator>
      <dc:date>2024-07-15T07:45:35Z</dc:date>
    </item>
  </channel>
</rss>

