<?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: DAX TOPN - Get top 5 count from split by values of another column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-TOPN-Get-top-5-count-from-split-by-values-of-another-column/m-p/1546669#M30554</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="188559" data-lia-user-login="janinw" class="lia-mention lia-mention-user"&gt;janinw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find below the measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Top 5 Reason = 
var __rank = 
RANKX (
    CALCULATETABLE (
        SUMMARIZE ( Sheet1, Sheet1[reason_specific_en] ),
        ALLSELECTED ( Sheet1)
    ),
    CALCULATE ( DISTINCTCOUNT ( Sheet1[ticket_id] ) ),
    ,
    DESC,
    DENSE
)
return

IF( 
    __rank &amp;lt;= 5 , 
    DISTINCTCOUNT ( Sheet1[ticket_id] )
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;________________________&lt;/P&gt;&lt;P&gt;If my answer was helpful, please click &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&lt;I&gt; to help other members find it useful&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Click on the &lt;STRONG&gt;Thumbs-Up icon &lt;/STRONG&gt;if you like this reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="https://www.excelfort.com" target="_blank"&gt;&lt;FONT color="blue"&gt;Website&lt;/FONT&gt;&lt;/A&gt; &lt;A href="https://www.youtube.com/channel/UCKwBEguA8IlBubIobaOormg?sub_confirmation=1" target="_blank"&gt;&lt;FONT color="blue"&gt;YouTube&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp; &lt;A href="https://linkedin.com/in/fowmy" target="_blank"&gt;&lt;FONT color="blue"&gt;LinkedIn&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 12 Dec 2020 12:40:07 GMT</pubDate>
    <dc:creator>Fowmy</dc:creator>
    <dc:date>2020-12-12T12:40:07Z</dc:date>
    <item>
      <title>DAX TOPN - Get top 5 count from split by values of another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-TOPN-Get-top-5-count-from-split-by-values-of-another-column/m-p/1546644#M30551</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am struggling with the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with several columns: 'date', 'ticket_id', 'reason_group', 'reason_specific'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Get the top 5 reasons from the column 'reason_specific'&lt;/LI&gt;&lt;LI&gt;Based on the distinct count of the column 'ticket_id'&lt;/LI&gt;&lt;LI&gt;Then &lt;U&gt;use this top 5 as a filter&lt;/U&gt; for a visual&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;BR /&gt;So, the first 5 reasons of the table below should be the filter for a visual.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting really lost with the TOPN, CALCULATE, CALCULATETABLE, SUMMARIZE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;Janine&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Dec 2020 11:35:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-TOPN-Get-top-5-count-from-split-by-values-of-another-column/m-p/1546644#M30551</guid>
      <dc:creator>janinw</dc:creator>
      <dc:date>2020-12-12T11:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: DAX TOPN - Get top 5 count from split by values of another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-TOPN-Get-top-5-count-from-split-by-values-of-another-column/m-p/1546647#M30552</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="188559" data-lia-user-login="janinw" class="lia-mention lia-mention-user"&gt;janinw&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can you share your data as a sample? This will help me to build the right solution as expected. You may create a dummy data set in Excel with the desired output.&lt;BR /&gt;You can save your files in OneDrive, Google Drive, or any other cloud sharing platform and share the link here.&lt;BR /&gt;____________________________________&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;How to paste sample data with your question?&lt;/A&gt;&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;How to get your questions answered quickly?&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;_____________________________________&lt;BR /&gt;Did I answer your question? Mark this post as a solution, this will help others!.&lt;/P&gt;&lt;P&gt;Click on the Thumbs-Up icon if you like this reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;A href="https://www.youtube.com/channel/UCKwBEguA8IlBubIobaOormg?sub_confirmation=1" target="_blank"&gt;YouTube, &lt;/A&gt;&lt;A href="https://linkedin.com/in/fowmy" target="_blank"&gt;LinkedIn&lt;/A&gt;&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Dec 2020 11:53:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-TOPN-Get-top-5-count-from-split-by-values-of-another-column/m-p/1546647#M30552</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2020-12-12T11:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: DAX TOPN - Get top 5 count from split by values of another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-TOPN-Get-top-5-count-from-split-by-values-of-another-column/m-p/1546654#M30553</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="52518" data-lia-user-login="Fowmy" class="lia-mention lia-mention-user"&gt;Fowmy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find a dummy dataset as requested here: &lt;A href="https://docs.google.com/spreadsheets/d/1K4sP3m6aqxV9JS0di3YYG_XvFRcZOak0up6Ti3Mhbw0/edit?usp=sharing" target="_self"&gt;Dummy Data&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Janine&lt;/P&gt;</description>
      <pubDate>Sat, 12 Dec 2020 12:10:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-TOPN-Get-top-5-count-from-split-by-values-of-another-column/m-p/1546654#M30553</guid>
      <dc:creator>janinw</dc:creator>
      <dc:date>2020-12-12T12:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: DAX TOPN - Get top 5 count from split by values of another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-TOPN-Get-top-5-count-from-split-by-values-of-another-column/m-p/1546669#M30554</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="188559" data-lia-user-login="janinw" class="lia-mention lia-mention-user"&gt;janinw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find below the measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Top 5 Reason = 
var __rank = 
RANKX (
    CALCULATETABLE (
        SUMMARIZE ( Sheet1, Sheet1[reason_specific_en] ),
        ALLSELECTED ( Sheet1)
    ),
    CALCULATE ( DISTINCTCOUNT ( Sheet1[ticket_id] ) ),
    ,
    DESC,
    DENSE
)
return

IF( 
    __rank &amp;lt;= 5 , 
    DISTINCTCOUNT ( Sheet1[ticket_id] )
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;________________________&lt;/P&gt;&lt;P&gt;If my answer was helpful, please click &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&lt;I&gt; to help other members find it useful&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Click on the &lt;STRONG&gt;Thumbs-Up icon &lt;/STRONG&gt;if you like this reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="https://www.excelfort.com" target="_blank"&gt;&lt;FONT color="blue"&gt;Website&lt;/FONT&gt;&lt;/A&gt; &lt;A href="https://www.youtube.com/channel/UCKwBEguA8IlBubIobaOormg?sub_confirmation=1" target="_blank"&gt;&lt;FONT color="blue"&gt;YouTube&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp; &lt;A href="https://linkedin.com/in/fowmy" target="_blank"&gt;&lt;FONT color="blue"&gt;LinkedIn&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Dec 2020 12:40:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-TOPN-Get-top-5-count-from-split-by-values-of-another-column/m-p/1546669#M30554</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2020-12-12T12:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: DAX TOPN - Get top 5 count from split by values of another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-TOPN-Get-top-5-count-from-split-by-values-of-another-column/m-p/1558699#M30914</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have realised an easy way of getting where I want is by doing the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a measure that calculates the % (or number) for reason_specific:&lt;BR /&gt;perc_tickets = divide(distinctcount([ticket_id]), calculate(distinctcount([ticket_id]), all([reason_specific])))&lt;/LI&gt;&lt;LI&gt;Then use the Top N filter type in PowerBI desktop.&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 08:59:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-TOPN-Get-top-5-count-from-split-by-values-of-another-column/m-p/1558699#M30914</guid>
      <dc:creator>janinw</dc:creator>
      <dc:date>2020-12-18T08:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: DAX TOPN - Get top 5 count from split by values of another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-TOPN-Get-top-5-count-from-split-by-values-of-another-column/m-p/1558712#M30915</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="52518" data-lia-user-login="Fowmy" class="lia-mention lia-mention-user"&gt;Fowmy&lt;/a&gt;&amp;nbsp; - your solution did not help in using it as a filter for a visual unfortunately. I had done similar things before, but that does not get me to what I want to do with it.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 09:01:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-TOPN-Get-top-5-count-from-split-by-values-of-another-column/m-p/1558712#M30915</guid>
      <dc:creator>janinw</dc:creator>
      <dc:date>2020-12-18T09:01:07Z</dc:date>
    </item>
  </channel>
</rss>

