<?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 RANKX not working properly (Adding 1 to the Rank when filtering a selection) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-not-working-properly-Adding-1-to-the-Rank-when-filtering-a/m-p/3049669#M156643</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a retail dashboard, where I analyse sales performance by band. I have 3 formulas that rank all Brands by the store (based on the type of product sold).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- Niche Rank (Ranks all sales from 'Niche' products)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RANK(NICHE) = IF (
    NOT ( ISBLANK ( [NicheSales(TY)] ) ),
    RANKX (
        FILTER ( ALL ( 'Niche Dashboard'[FINAL BRAND]), NOT ( ISBLANK ( [NicheSales(TY)] ) ) ),
        [NicheSales(TY)]
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- Classic Rank (Ranks all sales from 'Classic' products)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RANK(CLASSIC) = RANKX(ALL('Niche Dashboard'[FINAL BRAND]),[ClassicSales(TY)])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- Overall rank (Ranks total sales)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RANK(OVERALL) = RANKX(ALL('Niche Dashboard'[FINAL BRAND]),[NDAllSales(TY)])&lt;/LI-CODE&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;However, I noticed that when all brands are selected, the RANKX fuctions works perfectly, but if I select just 1 brand (see the second picture) the ranks go up by 1 for the selected brand. I have no idea what the issue is.&lt;/P&gt;&lt;P class="lia-align-center"&gt;&lt;U&gt;&lt;STRONG&gt;UNFILTERED&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P class="lia-align-center"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-center"&gt;&lt;STRONG&gt;&lt;U&gt;FILTERED&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jan 2023 07:05:49 GMT</pubDate>
    <dc:creator>Wycliff94</dc:creator>
    <dc:date>2023-01-30T07:05:49Z</dc:date>
    <item>
      <title>RANKX not working properly (Adding 1 to the Rank when filtering a selection)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-not-working-properly-Adding-1-to-the-Rank-when-filtering-a/m-p/3049669#M156643</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a retail dashboard, where I analyse sales performance by band. I have 3 formulas that rank all Brands by the store (based on the type of product sold).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- Niche Rank (Ranks all sales from 'Niche' products)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RANK(NICHE) = IF (
    NOT ( ISBLANK ( [NicheSales(TY)] ) ),
    RANKX (
        FILTER ( ALL ( 'Niche Dashboard'[FINAL BRAND]), NOT ( ISBLANK ( [NicheSales(TY)] ) ) ),
        [NicheSales(TY)]
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- Classic Rank (Ranks all sales from 'Classic' products)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RANK(CLASSIC) = RANKX(ALL('Niche Dashboard'[FINAL BRAND]),[ClassicSales(TY)])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- Overall rank (Ranks total sales)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RANK(OVERALL) = RANKX(ALL('Niche Dashboard'[FINAL BRAND]),[NDAllSales(TY)])&lt;/LI-CODE&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;However, I noticed that when all brands are selected, the RANKX fuctions works perfectly, but if I select just 1 brand (see the second picture) the ranks go up by 1 for the selected brand. I have no idea what the issue is.&lt;/P&gt;&lt;P class="lia-align-center"&gt;&lt;U&gt;&lt;STRONG&gt;UNFILTERED&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P class="lia-align-center"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-center"&gt;&lt;STRONG&gt;&lt;U&gt;FILTERED&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 07:05:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-not-working-properly-Adding-1-to-the-Rank-when-filtering-a/m-p/3049669#M156643</guid>
      <dc:creator>Wycliff94</dc:creator>
      <dc:date>2023-01-30T07:05:49Z</dc:date>
    </item>
  </channel>
</rss>

