<?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: Calculate average from a table with snapshots in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-from-a-table-with-snapshots/m-p/3704348#M144097</link>
    <description>&lt;P&gt;Sum divided by number of snapshots would work. Thanks for your help!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Feb 2024 15:23:08 GMT</pubDate>
    <dc:creator>pmonte</dc:creator>
    <dc:date>2024-02-16T15:23:08Z</dc:date>
    <item>
      <title>Calculate average from a table with snapshots</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-from-a-table-with-snapshots/m-p/3702016#M143982</link>
      <description>&lt;P&gt;I have a source table contains rows representing portfolio snapshots on specific dates, with columns: date, owner, category and number of items.&lt;BR /&gt;I need to create a table showing the owner and its average number of items in portfolio in a specific range of dates.&lt;/P&gt;&lt;P&gt;Owners are also grouped by geography (3 levels) in the table. So when I drill down to single owner I need to see avg of snapshots for the data range, if I drill up I need to display the SUM of the above mentioned averages.&lt;BR /&gt;The sheet includes sliders to set the range of dates, the owner(s) and category.&lt;BR /&gt;Can you guide me with the right DAX formulas?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 06:36:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-from-a-table-with-snapshots/m-p/3702016#M143982</guid>
      <dc:creator>pmonte</dc:creator>
      <dc:date>2024-02-16T06:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average from a table with snapshots</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-from-a-table-with-snapshots/m-p/3702191#M143985</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317715" data-lia-user-login="pmonte" class="lia-mention lia-mention-user"&gt;pmonte&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add owner in the table visual and try using this formula:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;AverageItems = AVERAGEX(VALUES(Table[Portfolio]), [NumberOfItems])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 19:12:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-from-a-table-with-snapshots/m-p/3702191#M143985</guid>
      <dc:creator>govindarajan_d</dc:creator>
      <dc:date>2024-02-15T19:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average from a table with snapshots</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-from-a-table-with-snapshots/m-p/3703224#M144034</link>
      <description>&lt;P&gt;Thanks &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="644992" data-lia-user-login="govindarajan_d" class="lia-mention lia-mention-user"&gt;govindarajan_d&lt;/a&gt;&amp;nbsp;for the suggestion but, I do not know how, I forgot the key part of the question (now I'll try to edit it).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Owners are also grouped by geography (3 levels) in the table. So when I drill down to single owner I need to see avg of snapshots for the data range, if I drill up I need to display the SUM of the above mentioned averages.&lt;/P&gt;&lt;P&gt;Any ideas?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 06:35:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-from-a-table-with-snapshots/m-p/3703224#M144034</guid>
      <dc:creator>pmonte</dc:creator>
      <dc:date>2024-02-16T06:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average from a table with snapshots</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-from-a-table-with-snapshots/m-p/3703252#M144038</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317715" data-lia-user-login="pmonte" class="lia-mention lia-mention-user"&gt;pmonte&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not know the exact columns you are using, but please modify the below according to your requirements:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ItemMeasure =
VAR __Average = AVERAGEX(VALUES(Table[Portfolio]), [NumberOfItems])
VAR __Sum = SUM([NumberOfItems])
RETURN IF(INSCOPE(Table[GeographyLevel3]),__Average,__Sum)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using INSCOPE we will be able to know at which level the current measure is being applied on and try to change the measure value accordingly&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 06:55:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-from-a-table-with-snapshots/m-p/3703252#M144038</guid>
      <dc:creator>govindarajan_d</dc:creator>
      <dc:date>2024-02-16T06:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average from a table with snapshots</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-from-a-table-with-snapshots/m-p/3704330#M144096</link>
      <description>&lt;P&gt;Sounds great but SUM will sum all snapshots while I need to sum the average for each owner.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's say that owner A (of Geo X) has two snapshots, 3 and 7, its AVG is 5. Then owner B (same Geo X) has two snapshots, 1 and 3 (AVG 2). If the table is showing owners I need to display A 5 and B 2. If the table shows Geo I need to display X 7 (while the sum of all snapshots would display 14.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 15:17:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-from-a-table-with-snapshots/m-p/3704330#M144096</guid>
      <dc:creator>pmonte</dc:creator>
      <dc:date>2024-02-16T15:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average from a table with snapshots</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-from-a-table-with-snapshots/m-p/3704348#M144097</link>
      <description>&lt;P&gt;Sum divided by number of snapshots would work. Thanks for your help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 15:23:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-from-a-table-with-snapshots/m-p/3704348#M144097</guid>
      <dc:creator>pmonte</dc:creator>
      <dc:date>2024-02-16T15:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average from a table with snapshots</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-from-a-table-with-snapshots/m-p/3704504#M144100</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317715" data-lia-user-login="pmonte" class="lia-mention lia-mention-user"&gt;pmonte&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please check this measure:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ItemMeasure = 
VAR __Average = AVERAGEX(VALUES('Table'[snapshot]),[SumOfItems])
VAR __Sum = SUMX(VALUES('Table'[Owner]),AVERAGE('Table'[Value]))
RETURN IF(ISINSCOPE('Table'[Owner]),__Average,__Sum)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created some sample data based on your comment and you can see the result below that&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 17:17:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-from-a-table-with-snapshots/m-p/3704504#M144100</guid>
      <dc:creator>govindarajan_d</dc:creator>
      <dc:date>2024-02-16T17:17:00Z</dc:date>
    </item>
  </channel>
</rss>

