<?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: TOPN Functions returns the same value as my COUNT aggregate function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-Functions-returns-the-same-value-as-my-COUNT-aggregate/m-p/4112505#M163204</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file whether it suits your requirement.&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;LI-CODE lang="markup"&gt;Sales: = 
SUM(data[sales])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;% top 3 sales: =
VAR _allsales =
    CALCULATE ( [Sales:], ALL ( data[category] ) )
VAR _topsales =
    CALCULATE ( [Sales:], TOPN ( 3, ALL ( data[category] ), [Sales:], DESC ) )
RETURN
    DIVIDE ( _topsales, _allsales )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Aug 2024 03:52:13 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2024-08-22T03:52:13Z</dc:date>
    <item>
      <title>TOPN Functions returns the same value as my COUNT aggregate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-Functions-returns-the-same-value-as-my-COUNT-aggregate/m-p/4111945#M163182</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hey everyone&lt;/SPAN&gt;&lt;SPAN&gt;. Sorry super new to posting.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;I have a measure that supposed to return the top 10 values of a table I&lt;/SPAN&gt;&lt;SPAN&gt;'m working with &lt;/SPAN&gt;&lt;SPAN&gt;(using Calculate and TopN&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;. I have another measure that just aggregates values &lt;/SPAN&gt;&lt;SPAN&gt;(using Count&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;. However&lt;/SPAN&gt;&lt;SPAN&gt;, as seen on the matrix table screenshot I attached here&lt;/SPAN&gt;&lt;SPAN&gt;, the TOPN measure returns the same values as my other measure&lt;/SPAN&gt;&lt;SPAN&gt;. Any idea why the TOPN isn&lt;/SPAN&gt;&lt;SPAN&gt;'t filtering the calculation&lt;/SPAN&gt;&lt;SPAN&gt;? TIA&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2024 19:30:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-Functions-returns-the-same-value-as-my-COUNT-aggregate/m-p/4111945#M163182</guid>
      <dc:creator>harmon-tuazon</dc:creator>
      <dc:date>2024-08-21T19:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: TOPN Functions returns the same value as my COUNT aggregate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-Functions-returns-the-same-value-as-my-COUNT-aggregate/m-p/4112505#M163204</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file whether it suits your requirement.&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;LI-CODE lang="markup"&gt;Sales: = 
SUM(data[sales])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;% top 3 sales: =
VAR _allsales =
    CALCULATE ( [Sales:], ALL ( data[category] ) )
VAR _topsales =
    CALCULATE ( [Sales:], TOPN ( 3, ALL ( data[category] ), [Sales:], DESC ) )
RETURN
    DIVIDE ( _topsales, _allsales )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 03:52:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-Functions-returns-the-same-value-as-my-COUNT-aggregate/m-p/4112505#M163204</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-08-22T03:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: TOPN Functions returns the same value as my COUNT aggregate function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-Functions-returns-the-same-value-as-my-COUNT-aggregate/m-p/4113294#M163242</link>
      <description>&lt;P&gt;Thanks for the reply from&amp;nbsp;Jihwan_Kim.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="795282" data-lia-user-login="harmon-tuazon" class="lia-mention lia-mention-user"&gt;harmon-tuazon&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;&lt;SPAN class=""&gt;Here I have another idea in mind, and I would like to share it for reference.Sample data is as follows:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.Create two measure:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#Meal Kits = COUNT(financials[Index])


#Top 10 Meal Kits Ordered =
VAR _p =
    SELECTEDVALUE ( financials[Product] )
RETURN
    MAXX (
        FILTER (
            TOPN (
                3,
                SUMMARIZE (
                    ALLSELECTED ( financials ),
                    'financials'[Product],
                    "Top",
                        CALCULATE (
                            COUNT ( 'financials'[Index] ),
                            ALLEXCEPT ( financials, financials[Product] )
                        )
                ),
                [Top], DESC
            ),
            'financials'[Product] = _p
        ),
        [Top]
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2.The top three product totals were successfully obtained using the measure just created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;BR /&gt;Zhu&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 10:06:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-Functions-returns-the-same-value-as-my-COUNT-aggregate/m-p/4113294#M163242</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-22T10:06:26Z</dc:date>
    </item>
  </channel>
</rss>

