<?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: Issue with calculating average of TOPN average in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-calculating-average-of-TOPN-average/m-p/1814057#M38357</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="298820" data-lia-user-login="PierreCome" class="lia-mention lia-mention-user"&gt;PierreCome&lt;/a&gt; , You can create a rank like this and use visual level filter &amp;lt;=5&lt;/P&gt;
&lt;P&gt;rankx(filter(allselected(Table[Year], Table[Week]), [Year] =max([year])), calculate(average(Table[X])),,desc, dense)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also refer&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/" target="_blank"&gt;https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Apr 2021 12:05:01 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2021-04-29T12:05:01Z</dc:date>
    <item>
      <title>Issue with calculating average of TOPN average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-calculating-average-of-TOPN-average/m-p/1813954#M38350</link>
      <description>&lt;P&gt;Good day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Being new to PBI I am struggling with calculating TOPN and would gladly accept your assistance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table that looks like this (4 years of data in total):&lt;/P&gt;&lt;P&gt;&lt;A href="https://ibb.co/T8vFdzr" target="_blank"&gt;https://ibb.co/T8vFdzr&lt;/A&gt;&lt;/P&gt;&lt;P&gt;column A = month&lt;/P&gt;&lt;P&gt;column B = year&lt;/P&gt;&lt;P&gt;column I = week&lt;/P&gt;&lt;P&gt;column N = filter 1&lt;/P&gt;&lt;P&gt;column X = Data I want to average then topN&lt;/P&gt;&lt;P&gt;column AD = filter 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically I want to be able to calculate the average per week of column X and be able to filter by column N and/or AD.&lt;/P&gt;&lt;P&gt;Then I get the top 5 weeks of a year and the average of that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With visuals, I managed to obtain it:&lt;/P&gt;&lt;P&gt;&lt;A href="https://ibb.co/QnHHtJh" target="_blank"&gt;https://ibb.co/QnHHtJh&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But for the rest of the project, I need to &lt;U&gt;calculate&lt;/U&gt; the difference between each week's average of column X and the average of the TOP 5 weeks.&lt;/P&gt;&lt;P&gt;Here is what it would look like in a matrix:&lt;/P&gt;&lt;P&gt;&lt;A href="https://ibb.co/G5VFjRq" target="_blank"&gt;https://ibb.co/G5VFjRq&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I cannot find a way to calculate that "the average of the TOP 5 weeks.", which is visible in the visual:&lt;/P&gt;&lt;P&gt;&lt;A href="https://ibb.co/x1fvGVy" target="_blank"&gt;https://ibb.co/x1fvGVy&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your assistance, I have been trying every possible solution I could find for the last days, but no success so far. And I am pretty sure this is quite simple.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope I was clear enough.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 11:04:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-calculating-average-of-TOPN-average/m-p/1813954#M38350</guid>
      <dc:creator>PierreCome</dc:creator>
      <dc:date>2021-04-29T11:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with calculating average of TOPN average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-calculating-average-of-TOPN-average/m-p/1814057#M38357</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="298820" data-lia-user-login="PierreCome" class="lia-mention lia-mention-user"&gt;PierreCome&lt;/a&gt; , You can create a rank like this and use visual level filter &amp;lt;=5&lt;/P&gt;
&lt;P&gt;rankx(filter(allselected(Table[Year], Table[Week]), [Year] =max([year])), calculate(average(Table[X])),,desc, dense)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also refer&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/" target="_blank"&gt;https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 12:05:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-calculating-average-of-TOPN-average/m-p/1814057#M38357</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-04-29T12:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with calculating average of TOPN average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-calculating-average-of-TOPN-average/m-p/1814210#M38364</link>
      <description>&lt;P&gt;Thank you for your answer, I will try this and come back to you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 13:17:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Issue-with-calculating-average-of-TOPN-average/m-p/1814210#M38364</guid>
      <dc:creator>PierreCome</dc:creator>
      <dc:date>2021-04-29T13:17:20Z</dc:date>
    </item>
  </channel>
</rss>

