<?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: Power BI: Dynamic Top N Filtering Based on Selection? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-Dynamic-Top-N-Filtering-Based-on-Selection/m-p/4405824#M174920</link>
    <description>&lt;P&gt;Hi Adi38612,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does your &lt;STRONG&gt;ID&lt;/STRONG&gt; column have unique values? How is the &lt;STRONG&gt;ID&lt;/STRONG&gt; column made up? Is it related to the &lt;STRONG&gt;Name&lt;/STRONG&gt; column?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Maral&lt;/P&gt;</description>
    <pubDate>Tue, 11 Feb 2025 22:18:10 GMT</pubDate>
    <dc:creator>amarma</dc:creator>
    <dc:date>2025-02-11T22:18:10Z</dc:date>
    <item>
      <title>Power BI: Dynamic Top N Filtering Based on Selection?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-Dynamic-Top-N-Filtering-Based-on-Selection/m-p/4405731#M174914</link>
      <description>&lt;P&gt;I have a &lt;STRONG&gt;Power BI table&lt;/STRONG&gt; with three columns: &lt;STRONG&gt;ID, Title, and Name&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created two &lt;STRONG&gt;clustered bar charts&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Chart 1&lt;/STRONG&gt; → Shows the &lt;STRONG&gt;Top 3 Names&lt;/STRONG&gt; (Y-axis: Name, X-axis: Count of ID).&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Chart 2&lt;/STRONG&gt; → Shows the &lt;STRONG&gt;Top 3 Titles&lt;/STRONG&gt; (Y-axis: Title, X-axis: Count of ID).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each chart has a &lt;STRONG&gt;visual-level filter&lt;/STRONG&gt; applied to show only the &lt;STRONG&gt;top 3&lt;/STRONG&gt; based on &lt;STRONG&gt;ID count&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;&lt;STRONG&gt;Issue:&lt;/STRONG&gt;&lt;/H3&gt;&lt;P&gt;When I select a Name in &lt;STRONG&gt;Chart 1&lt;/STRONG&gt;, &lt;STRONG&gt;Chart 2 updates&lt;/STRONG&gt;, but it &lt;STRONG&gt;does not recalculate the top 3 Titles based on the selected Name&lt;/STRONG&gt;—it just filters the existing top 3 Titles. Similarly, selecting a Title in &lt;STRONG&gt;Chart 2&lt;/STRONG&gt; does not dynamically update the &lt;STRONG&gt;top 3 Names&lt;/STRONG&gt; in &lt;STRONG&gt;Chart 1&lt;/STRONG&gt;.&lt;/P&gt;&lt;H3&gt;&amp;nbsp;&lt;/H3&gt;&lt;H3&gt;&lt;STRONG&gt;Desired Outcome:&lt;/STRONG&gt;&lt;/H3&gt;&lt;P&gt;If I select a &lt;STRONG&gt;Name&lt;/STRONG&gt;, I want &lt;STRONG&gt;Chart 2&lt;/STRONG&gt; to show the &lt;STRONG&gt;Top 3 Titles related to that Name&lt;/STRONG&gt; (not just filter the default top 3). Likewise, selecting a &lt;STRONG&gt;Title&lt;/STRONG&gt; should update &lt;STRONG&gt;Chart 1&lt;/STRONG&gt; to show the &lt;STRONG&gt;Top 3 Names related to that Title&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: There are more than 1000 records in my table, and there are more than 20 distinct Titles and Names each.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to achieve this in Power BI?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 19:59:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-Dynamic-Top-N-Filtering-Based-on-Selection/m-p/4405731#M174914</guid>
      <dc:creator>adi38612</dc:creator>
      <dc:date>2025-02-11T19:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI: Dynamic Top N Filtering Based on Selection?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-Dynamic-Top-N-Filtering-Based-on-Selection/m-p/4405824#M174920</link>
      <description>&lt;P&gt;Hi Adi38612,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does your &lt;STRONG&gt;ID&lt;/STRONG&gt; column have unique values? How is the &lt;STRONG&gt;ID&lt;/STRONG&gt; column made up? Is it related to the &lt;STRONG&gt;Name&lt;/STRONG&gt; column?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Maral&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 22:18:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-Dynamic-Top-N-Filtering-Based-on-Selection/m-p/4405824#M174920</guid>
      <dc:creator>amarma</dc:creator>
      <dc:date>2025-02-11T22:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI: Dynamic Top N Filtering Based on Selection?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-Dynamic-Top-N-Filtering-Based-on-Selection/m-p/4406231#M174935</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="650428" data-lia-user-login="adi38612" class="lia-mention lia-mention-user"&gt;adi38612&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;According to your question, you want to filter the first table (e.g. name) and then sort based on the values filtered by the first table right?&lt;BR /&gt;We can first use the RANKX function on the name column and total column sorting, and then create a new Topn table to Topn table to filter you need the first few rankings, and finally write a measure to put into each chart to achieve your needs!&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Name ID Count = 
 CALCULATE(COUNT('Table'[ID]), ALLEXCEPT('Table', 'Table'[Name]))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Rankx Name = 
RANKX(ALLSELECTED('Table'[Name]),[Name ID Count],,DESC,Dense)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Top N = GENERATESERIES(1, 10, 1)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Top N Names = IF([Rankx Name]  &amp;lt;=SELECTEDVALUE('Top N'[Top N]), 1, 0)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you have any other questions, you can check out the pbix file I uploaded, I hope it helps, and I'd be honored if I could solve your problem!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Hope it helps!&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Community Support Team_ Tom Shen&lt;/P&gt;
&lt;P&gt;If this post helps then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 05:11:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-Dynamic-Top-N-Filtering-Based-on-Selection/m-p/4406231#M174935</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-02-12T05:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI: Dynamic Top N Filtering Based on Selection?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-Dynamic-Top-N-Filtering-Based-on-Selection/m-p/4407019#M174984</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;Anonymous&lt;/a&gt;, It worked like a charm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Quick update: the 'Filter' interactions between the two visuals should be enabled, both ways!&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 12:51:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Power-BI-Dynamic-Top-N-Filtering-Based-on-Selection/m-p/4407019#M174984</guid>
      <dc:creator>adi38612</dc:creator>
      <dc:date>2025-02-12T12:51:37Z</dc:date>
    </item>
  </channel>
</rss>

