<?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: Displaying the top N% of a category in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-the-top-N-of-a-category/m-p/2268428#M55124</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you post sample data as &lt;FONT face="arial black,avant garde" color="#FF0000"&gt;&lt;STRONG&gt;text&lt;/STRONG&gt; &lt;/FONT&gt;and expected output?&lt;BR /&gt;Not enough information to go on;&lt;BR /&gt;&lt;BR /&gt;please see this post regarding How to Get Your Question Answered Quickly:&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;The most important parts are:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;1. Sample data as text, use the table tool in the editing bar&lt;BR /&gt;2. Expected output from sample data&lt;BR /&gt;3. Explanation in words of how to get from 1. to 2.&lt;BR /&gt;4. Relation between your tables&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;Appreciate your Kudos!!&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;LinkedIn:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;A href="https://www.linkedin.com/in/vahid-dm/" target="_blank"&gt;www.linkedin.com/in/vahid-dm/&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jan 2022 01:17:58 GMT</pubDate>
    <dc:creator>VahidDM</dc:creator>
    <dc:date>2022-01-06T01:17:58Z</dc:date>
    <item>
      <title>Displaying the top N% of a category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-the-top-N-of-a-category/m-p/2268329#M55118</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to write a measure where i'd be able to display the top N% of a category, possible this would dynamic so would change upon changing of the slicer. Is this possible?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be very much appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 00:06:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-the-top-N-of-a-category/m-p/2268329#M55118</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-06T00:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying the top N% of a category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-the-top-N-of-a-category/m-p/2268385#M55122</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you provide a sample of your data and expected result in a text format?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW, check these links:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Display-Top-N-by-Category-and-Sub-Category/m-p/2121269" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/Display-Top-N-by-Category-and-Sub-Category/m-p/2121269&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/Show-Top-N-Rank-Category/m-p/2136606" target="_blank"&gt;https://community.powerbi.com/t5/DAX-Commands-and-Tips/Show-Top-N-Rank-Category/m-p/2136606&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Top-N-Categories-within-the-Nth-Category/m-p/2175433" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/Top-N-Categories-within-the-Nth-Category/m-p/2175433&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Top-N-states-within-TOP-N-category/m-p/1828635" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/Top-N-states-within-TOP-N-category/m-p/1828635&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;helps&lt;/SPAN&gt;&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;accepting&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;it as the solution&lt;/SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;Appreciate your Kudos!!&lt;BR /&gt;&lt;STRONG&gt;LinkedIn:&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;A href="https://www.linkedin.com/in/vahid-dm/" target="_blank"&gt;www.linkedin.com/in/vahid-dm/&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 00:37:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-the-top-N-of-a-category/m-p/2268385#M55122</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2022-01-06T00:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying the top N% of a category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-the-top-N-of-a-category/m-p/2268423#M55123</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your help. please see an image of some of the data. I'd be looking to see the top 20% of category of units sold changing each month.&amp;nbsp;&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;</description>
      <pubDate>Thu, 06 Jan 2022 01:12:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-the-top-N-of-a-category/m-p/2268423#M55123</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-06T01:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying the top N% of a category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-the-top-N-of-a-category/m-p/2268428#M55124</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you post sample data as &lt;FONT face="arial black,avant garde" color="#FF0000"&gt;&lt;STRONG&gt;text&lt;/STRONG&gt; &lt;/FONT&gt;and expected output?&lt;BR /&gt;Not enough information to go on;&lt;BR /&gt;&lt;BR /&gt;please see this post regarding How to Get Your Question Answered Quickly:&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;The most important parts are:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;1. Sample data as text, use the table tool in the editing bar&lt;BR /&gt;2. Expected output from sample data&lt;BR /&gt;3. Explanation in words of how to get from 1. to 2.&lt;BR /&gt;4. Relation between your tables&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;Appreciate your Kudos!!&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;LinkedIn:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;A href="https://www.linkedin.com/in/vahid-dm/" target="_blank"&gt;www.linkedin.com/in/vahid-dm/&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 01:17:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-the-top-N-of-a-category/m-p/2268428#M55124</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2022-01-06T01:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying the top N% of a category</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-the-top-N-of-a-category/m-p/2274703#M55473</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The idea is to first calculate the sales ranking, and then take 20% of the ranking to display.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sample data&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's my solution.&lt;/P&gt;
&lt;P&gt;1.Create a rank measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;RANK = 
RANKX (
    FILTER ( ALLSELECTED ( 'Table' ), [Date] = MAX ( 'Table'[Date] ) ),
    CALCULATE ( SUM ( 'Table'[Sales] ) ),
    ,
    DESC,
    DENSE
)
&lt;/LI-CODE&gt;
&lt;P&gt;You can get a sort grouped by year and month.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2.Create a flag measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FLAG = 
VAR _20 =
    ROUNDDOWN (
        MAXX (
            FILTER ( ALLSELECTED ( 'Table' ), [Date] = MAX ( 'Table'[Date] ) ),
            [RANK]
        ) * 0.2,
        0
    )
RETURN
    IF ( [RANK] &amp;lt;= _20, 1 )
&lt;/LI-CODE&gt;
&lt;P&gt;Put that measure into filters, set show items when the value is 1.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can filter year month in the slicer.&lt;/P&gt;
&lt;P&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;Best Regards,&lt;/P&gt;
&lt;P&gt;Stephen Tao&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&lt;STRONG&gt;&lt;EM&gt; Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 06:48:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Displaying-the-top-N-of-a-category/m-p/2274703#M55473</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-10T06:48:05Z</dc:date>
    </item>
  </channel>
</rss>

