<?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 formula confusion in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-formula-confusion/m-p/3021473#M102823</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I suggest creating a data model like below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&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;LI-CODE lang="markup"&gt;Sales measure: = 
SUM( Data[Sales] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Ranking: =
SWITCH (
    TRUE (),
    ISINSCOPE ( 'Sub Category'[Sub Category] ), RANKX ( ALL ( 'Sub Category'[Sub Category] ), [Sales measure:],, DESC ),
    ISINSCOPE ( 'Sub Category'[Category] ), RANKX ( ALL ( 'Sub Category'[Category] ), [Sales measure:],, DESC )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 15 Jan 2023 15:00:52 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2023-01-15T15:00:52Z</dc:date>
    <item>
      <title>RANKX formula confusion</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-formula-confusion/m-p/3021409#M102810</link>
      <description>&lt;P&gt;Dear Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset in which Category, Sub Category and Sales are given.&lt;/P&gt;&lt;P&gt;I wish to create a matrix in which i want to see RANK based Category and Sub category when selected.&lt;/P&gt;&lt;P&gt;I have created one Fact table and 2 Dimention tables (Category table &amp;amp; Sub category table) and established relationships.&lt;/P&gt;&lt;P&gt;I want to see RANKS of each category in Matrix and while expanding the category button, rank should modify based on Sub category within same category.&lt;/P&gt;&lt;P&gt;Please note: sales column is from "Fact table", Sub category column from "Sub category table" and Category column from "Category table" as shown below.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&amp;nbsp; &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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jan 2023 12:17:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-formula-confusion/m-p/3021409#M102810</guid>
      <dc:creator>rahulmmenon</dc:creator>
      <dc:date>2023-01-15T12:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: RANKX formula confusion</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-formula-confusion/m-p/3021473#M102823</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I suggest creating a data model like below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&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;LI-CODE lang="markup"&gt;Sales measure: = 
SUM( Data[Sales] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Ranking: =
SWITCH (
    TRUE (),
    ISINSCOPE ( 'Sub Category'[Sub Category] ), RANKX ( ALL ( 'Sub Category'[Sub Category] ), [Sales measure:],, DESC ),
    ISINSCOPE ( 'Sub Category'[Category] ), RANKX ( ALL ( 'Sub Category'[Category] ), [Sales measure:],, DESC )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jan 2023 15:00:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-formula-confusion/m-p/3021473#M102823</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-01-15T15:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: RANKX formula confusion</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-formula-confusion/m-p/3024610#M103069</link>
      <description>&lt;P&gt;Hi Jihwan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your support on this. This gives a solution for my problem when the Category and Sub category columns are in same Dimention table. I actually wanted to do the same where Category and Sub category are two different Dimention tables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, since this gives a solution, i would like to go ahead with this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks once again for your support.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 03:09:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RANKX-formula-confusion/m-p/3024610#M103069</guid>
      <dc:creator>rahulmmenon</dc:creator>
      <dc:date>2023-01-17T03:09:23Z</dc:date>
    </item>
  </channel>
</rss>

