<?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: Getting Rank of Text Column which has duplicate records in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Rank-of-Text-Column-which-has-duplicate-records/m-p/936785#M9821</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the easiest way is to add a Custom Index Column in Power Query Editor mode&lt;/P&gt;
&lt;P&gt;then try to create a calculated DAX column like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;RANK = 
var _RowsBefore = COUNTROWS(FILTER('Table', 'Table'[Name]&amp;lt;EARLIER('Table'[Name])))
RETURN
rankx(FILTER('Table', 'Table'[Name]=EARLIER('Table'[Name])), 'Table'[Index],,ASC) + _RowsBefore&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Feb 2020 08:19:18 GMT</pubDate>
    <dc:creator>az38</dc:creator>
    <dc:date>2020-02-18T08:19:18Z</dc:date>
    <item>
      <title>Getting Rank of Text Column which has duplicate records</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Rank-of-Text-Column-which-has-duplicate-records/m-p/936742#M9820</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am not sure how to mention this. I have a simple table as below. I am trying to get the rank basis on 'Name' Column which has duplicate record.&amp;nbsp;Can any one help whether this can be achieved in power bi? Thanks in Advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Desired Output (Rank)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 07:49:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Rank-of-Text-Column-which-has-duplicate-records/m-p/936742#M9820</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-18T07:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Rank of Text Column which has duplicate records</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Rank-of-Text-Column-which-has-duplicate-records/m-p/936785#M9821</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the easiest way is to add a Custom Index Column in Power Query Editor mode&lt;/P&gt;
&lt;P&gt;then try to create a calculated DAX column like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;RANK = 
var _RowsBefore = COUNTROWS(FILTER('Table', 'Table'[Name]&amp;lt;EARLIER('Table'[Name])))
RETURN
rankx(FILTER('Table', 'Table'[Name]=EARLIER('Table'[Name])), 'Table'[Index],,ASC) + _RowsBefore&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 08:19:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Rank-of-Text-Column-which-has-duplicate-records/m-p/936785#M9821</guid>
      <dc:creator>az38</dc:creator>
      <dc:date>2020-02-18T08:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Rank of Text Column which has duplicate records</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Rank-of-Text-Column-which-has-duplicate-records/m-p/936841#M9824</link>
      <description>&lt;P&gt;Hi &lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A title="" href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/82403" target="_self"&gt;&lt;SPAN class="login-bold"&gt;az38&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;I tried the way you mentioned however its producing rank for all. Please see below-&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 18 Feb 2020 08:48:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Rank-of-Text-Column-which-has-duplicate-records/m-p/936841#M9824</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-18T08:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Rank of Text Column which has duplicate records</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Rank-of-Text-Column-which-has-duplicate-records/m-p/937039#M9828</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you've added your index column, you can use the DAX expression below to create your rank column:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rank = 
VAR RowName = Table1[Name]
VAR Result = 
RANKX(
    FILTER(
        ALL( Table1 ),
        Table1[Name] = RowName
    ),
    Table1[Index],
    ,ASC
)
RETURN Result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Martyn&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 10:19:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Rank-of-Text-Column-which-has-duplicate-records/m-p/937039#M9828</guid>
      <dc:creator>MartynRamsden</dc:creator>
      <dc:date>2020-02-18T10:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Rank of Text Column which has duplicate records</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Rank-of-Text-Column-which-has-duplicate-records/m-p/937088#M9833</link>
      <description>&lt;P&gt;Create one index column and then create one more column as below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Rank = CALCULATE(COUNT('Table'[Col]),FILTER('Table','Table'[Col]=EARLIER('Table'[Col]) &amp;amp;&amp;amp; 'Table'[Index]&amp;lt;=EARLIER('Table'[Index])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks &amp;amp; regards,&lt;BR /&gt;Pravin Wattamwar&lt;BR /&gt;&lt;A href="http://www.linkedin.com/in/pravin-p-wattamwar" target="_blank"&gt;www.linkedin.com/in/pravin-p-wattamwar&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If I resolve your problem Mark it as a solution and give kudos.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 18 Feb 2020 10:47:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Rank-of-Text-Column-which-has-duplicate-records/m-p/937088#M9833</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-18T10:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Rank of Text Column which has duplicate records</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Rank-of-Text-Column-which-has-duplicate-records/m-p/937118#M9835</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="98062" data-lia-user-login="MartynRamsden" class="lia-mention lia-mention-user"&gt;MartynRamsden&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perfect! This answers my query. Thanks a lot for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 11:12:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Rank-of-Text-Column-which-has-duplicate-records/m-p/937118#M9835</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-18T11:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Rank of Text Column which has duplicate records</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Rank-of-Text-Column-which-has-duplicate-records/m-p/937123#M9836</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perfect, This is also a solution to my concern. Thanks a lot for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 11:14:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Rank-of-Text-Column-which-has-duplicate-records/m-p/937123#M9836</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-18T11:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Rank of Text Column which has duplicate records</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Rank-of-Text-Column-which-has-duplicate-records/m-p/1930343#M41900</link>
      <description>&lt;P&gt;I have a similar problem with ranking. What I need is to have all channel_grouping_1 have the same rank. Offline Only 1 across all lines, Direct 2 across all lines etc. Can anyone help?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 09:17:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Getting-Rank-of-Text-Column-which-has-duplicate-records/m-p/1930343#M41900</guid>
      <dc:creator>Tani4ka</dc:creator>
      <dc:date>2021-06-30T09:17:25Z</dc:date>
    </item>
  </channel>
</rss>

