<?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: Rankx with Top N driving me nuts. Please help in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4721126#M180818</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="633018" data-lia-user-login="cruncher" class="lia-mention lia-mention-user"&gt;cruncher&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Thank you for the update.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Sales Rank =&lt;BR /&gt;VAR _selectedSource = SELECTEDVALUE('Source Parameter'[Source])&lt;/P&gt;
&lt;P&gt;VAR _topN = SELECTEDVALUE('Top N Parameter'[Value])&lt;/P&gt;
&lt;P&gt;VAR _filteredTable = FILTER(ALLSELECTED(Sheet2), Sheet2[Include] = "Yes"&amp;amp;&amp;amp; Sheet2[Rank] = "Yes"&amp;amp;&amp;amp; Sheet2[Source] = _selectedSource)&lt;/P&gt;
&lt;P&gt;RETURN&lt;BR /&gt;IF (Sheet2[Include] = "Yes" &amp;amp;&amp;amp; Sheet2[Rank] = "Yes"&amp;amp;&amp;amp; Sheet2[Source] = _selectedSource,&lt;BR /&gt;RANKX(_filteredTable,[Sales $],,DESC,DENSE))&lt;BR /&gt;&lt;BR /&gt;,and a measure to filter top n results&lt;BR /&gt;&lt;BR /&gt;Show_Top_N =&lt;BR /&gt;VAR _topN = SELECTEDVALUE('Top N Parameter'[Value])&lt;BR /&gt;RETURN&lt;BR /&gt;IF([Sales Rank] &amp;lt;= _topN, 1, 0)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting as solution&amp;nbsp;to help the other members find it more quickly,&amp;nbsp;don't forget to give a&amp;nbsp;"Kudos"&amp;nbsp;– I’d truly appreciate it!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jun 2025 09:11:31 GMT</pubDate>
    <dc:creator>v-echaithra</dc:creator>
    <dc:date>2025-06-05T09:11:31Z</dc:date>
    <item>
      <title>Rankx with Top N driving me nuts. Please help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4700668#M180063</link>
      <description>&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having a hard time finding the correct rank with TopN and filters/slicers in matrix view. My data looks like this.&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These are my requirements.&lt;/P&gt;&lt;P&gt;1. Filter the data where Rank=Yes.&lt;/P&gt;&lt;P&gt;2. Create a Single select Parameter from source field excluding any blanks values.&lt;/P&gt;&lt;P&gt;3. Filter the data to respective source as per user selection.&lt;/P&gt;&lt;P&gt;4. Rank by Region and sales.&lt;/P&gt;&lt;P&gt;5. Add Rank, Region, Category, Include, Sales in Table/Matrix view&lt;/P&gt;&lt;P&gt;6. Add Include field to filters. Rank should be calculated after filtering the data.&lt;/P&gt;&lt;P&gt;7. Create a Top N type in parameter and show regions Rank less than Top N value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried multiple things by changing the context using All and All selected, Remove filters, Calculate but not able to filter the correct topn 1 ranks after the filter/slicer selection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the pbix file with sample data&amp;nbsp;&lt;A title="PBIX link" href="https://fileport.io/h3XwNnVEuCbZ" target="_self"&gt;PBIX link&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help. Many thanks in advance. Appreciate if someone invest some time to solve this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ombir&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 22:13:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4700668#M180063</guid>
      <dc:creator>cruncher</dc:creator>
      <dc:date>2025-05-20T22:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Rankx with Top N driving me nuts. Please help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4700694#M180064</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="633018" data-lia-user-login="cruncher" class="lia-mention lia-mention-user"&gt;cruncher&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Does this resolve the issue?&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 23:07:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4700694#M180064</guid>
      <dc:creator>adudani</dc:creator>
      <dc:date>2025-05-20T23:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rankx with Top N driving me nuts. Please help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4700789#M180066</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/633018" target="_self"&gt;&lt;SPAN class=""&gt;cruncher&lt;/SPAN&gt;&lt;/A&gt;,&lt;BR /&gt;&lt;BR /&gt;As always DAX is harder to understand when compared with writing SQL queries. I would suggest below for you:&lt;BR /&gt;1.First come up with a sql query to retrieve the result as per your business logic.&lt;BR /&gt;2.Second thing is translate the same logic in to DAX expression&lt;BR /&gt;3.It will be easy to understand SQL and DAX simultaneouly how it works and behave.&lt;BR /&gt;4. As you know there is no single solution for problem to solve. You can come up with multiple approaches to solve the same problem.&amp;nbsp;&lt;BR /&gt;5. Be cool &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;&lt;A href="https://cloudbiexpert-my.sharepoint.com/:u:/p/maruthi/EZwzdRJrE2xHg8f-klj3dd4B8IWC8odRBEaDEXZxsIHpVQ?e=PaOfdO" target="_blank" rel="noopener"&gt;Rankx.pbix&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you have further questions.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too.&amp;nbsp;And if you found it useful, a quick "Kudos" is always appreciated, thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maruthi&amp;nbsp;&lt;/P&gt;&lt;P&gt;LinkedIn -&amp;nbsp;&lt;A href="http://www.linkedin.com/in/maruthi-siva-prasad/" target="_blank" rel="nofollow noopener noreferrer"&gt;http://www.linkedin.com/in/maruthi-siva-prasad/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;X&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp;&amp;nbsp;&lt;A href="https://x.com/maruthisp" target="_blank" rel="nofollow noopener noreferrer"&gt;Maruthi Siva Prasad - (@MaruthiSP) / X&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2025 02:56:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4700789#M180066</guid>
      <dc:creator>maruthisp</dc:creator>
      <dc:date>2025-05-21T02:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Rankx with Top N driving me nuts. Please help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4702263#M180098</link>
      <description>&lt;P&gt;Thanks for looking into it. It returns wrong rank.&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you check and also include Top N parameter to filter the rank&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2025 18:46:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4702263#M180098</guid>
      <dc:creator>cruncher</dc:creator>
      <dc:date>2025-05-21T18:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Rankx with Top N driving me nuts. Please help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4702269#M180099</link>
      <description>&lt;P&gt;Thanks for looking into it. It returns wrong rank and Top N is not working. Please check&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>Wed, 21 May 2025 18:56:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4702269#M180099</guid>
      <dc:creator>cruncher</dc:creator>
      <dc:date>2025-05-21T18:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Rankx with Top N driving me nuts. Please help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4721126#M180818</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="633018" data-lia-user-login="cruncher" class="lia-mention lia-mention-user"&gt;cruncher&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Thank you for the update.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Sales Rank =&lt;BR /&gt;VAR _selectedSource = SELECTEDVALUE('Source Parameter'[Source])&lt;/P&gt;
&lt;P&gt;VAR _topN = SELECTEDVALUE('Top N Parameter'[Value])&lt;/P&gt;
&lt;P&gt;VAR _filteredTable = FILTER(ALLSELECTED(Sheet2), Sheet2[Include] = "Yes"&amp;amp;&amp;amp; Sheet2[Rank] = "Yes"&amp;amp;&amp;amp; Sheet2[Source] = _selectedSource)&lt;/P&gt;
&lt;P&gt;RETURN&lt;BR /&gt;IF (Sheet2[Include] = "Yes" &amp;amp;&amp;amp; Sheet2[Rank] = "Yes"&amp;amp;&amp;amp; Sheet2[Source] = _selectedSource,&lt;BR /&gt;RANKX(_filteredTable,[Sales $],,DESC,DENSE))&lt;BR /&gt;&lt;BR /&gt;,and a measure to filter top n results&lt;BR /&gt;&lt;BR /&gt;Show_Top_N =&lt;BR /&gt;VAR _topN = SELECTEDVALUE('Top N Parameter'[Value])&lt;BR /&gt;RETURN&lt;BR /&gt;IF([Sales Rank] &amp;lt;= _topN, 1, 0)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting as solution&amp;nbsp;to help the other members find it more quickly,&amp;nbsp;don't forget to give a&amp;nbsp;"Kudos"&amp;nbsp;– I’d truly appreciate it!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 09:11:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4721126#M180818</guid>
      <dc:creator>v-echaithra</dc:creator>
      <dc:date>2025-06-05T09:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Rankx with Top N driving me nuts. Please help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4725129#M180991</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="633018" data-lia-user-login="cruncher" class="lia-mention lia-mention-user"&gt;cruncher&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;We wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?&lt;BR /&gt;If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Chaithra.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jun 2025 06:43:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4725129#M180991</guid>
      <dc:creator>v-echaithra</dc:creator>
      <dc:date>2025-06-09T06:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Rankx with Top N driving me nuts. Please help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4729829#M181184</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="633018" data-lia-user-login="cruncher" class="lia-mention lia-mention-user"&gt;cruncher&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;As we haven’t heard back from you, so just following up to our previous message. I'd like to confirm if you've successfully resolved this issue or if you need further help.&lt;/P&gt;
&lt;P&gt;If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. If you find a reply particularly helpful to you, you can also mark it as a solution.&lt;BR /&gt;If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.&lt;BR /&gt;&lt;BR /&gt;Thank you for your patience and look forward to hearing from you.&lt;BR /&gt;Best Regards,&lt;BR /&gt;Chaithra E.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2025 08:56:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4729829#M181184</guid>
      <dc:creator>v-echaithra</dc:creator>
      <dc:date>2025-06-12T08:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Rankx with Top N driving me nuts. Please help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4731630#M181249</link>
      <description>&lt;P&gt;Hi cruncher, I am not sure I got what you need, can you please clarify on my below questions?&lt;/P&gt;&lt;P&gt;1. Filter the data where Rank=Yes.&lt;/P&gt;&lt;P&gt;2. Create a Single select Parameter from source field excluding any blanks values.&lt;/P&gt;&lt;P&gt;3. Filter the data to respective source as per user selection.&lt;/P&gt;&lt;P&gt;FB what do you mean in point 3.? Having a slicer with regions to be selected?&lt;/P&gt;&lt;P&gt;4. Rank by Region and sales.&lt;/P&gt;&lt;P&gt;FB Please clarify what you need to rank and by which value (es Rank Regions by Sales )&lt;/P&gt;&lt;P&gt;5. Add Rank, Region, Category, Include, Sales in Table/Matrix view&lt;/P&gt;&lt;P&gt;6. Add Include field to filters. Rank should be calculated after filtering the data.&lt;/P&gt;&lt;P&gt;7. Create a Top N type in parameter and show regions Rank less than Top N value.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jun 2025 13:39:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4731630#M181249</guid>
      <dc:creator>FBergamaschi</dc:creator>
      <dc:date>2025-06-13T13:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Rankx with Top N driving me nuts. Please help</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4732907#M181290</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="633018" data-lia-user-login="cruncher" class="lia-mention lia-mention-user"&gt;cruncher&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;May I ask if you have gotten this issue resolved?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Chaithra.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2025 06:31:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rankx-with-Top-N-driving-me-nuts-Please-help/m-p/4732907#M181290</guid>
      <dc:creator>v-echaithra</dc:creator>
      <dc:date>2025-06-16T06:31:38Z</dc:date>
    </item>
  </channel>
</rss>

