<?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 Adding RAND() number to measure and RANKX() it in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-RAND-number-to-measure-and-RANKX-it/m-p/2635355#M77241</link>
    <description>&lt;P&gt;Hi, everyone.&lt;/P&gt;&lt;P&gt;I have a problem when i am using RANKX() function.&lt;/P&gt;&lt;P&gt;I have a one column table that contains redundant category names (AAA, BBB, CCC.....FFF) and have a measure that counts rows through a table:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;Counts = &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;COUNT(&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;'table'[Dim]&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am going to rank my rows, to do that i have a measure:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;RankRows = &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;RANKX(ALL('table'[Dim]), [Counts] ,, DESC)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;When i put those measures (rank and count) and column into a table i have the following:&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;As you can see categories EEE, FFF have the same counts and as a result the same rank.&lt;/P&gt;&lt;P&gt;I want to get rid of this, i need to get the unique rank for the each row.&lt;/P&gt;&lt;P&gt;To do that, "Counts" measure was modified a bit i added random number and expected to get correct rank, but i have this:&lt;/P&gt;&lt;img /&gt;&lt;P&gt;"Counts" was modified like this:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;Counts = &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;COUNT(&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;'table'[Dim]&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;) + DIVIDE(RAND(), 100)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Could somebody help or explain way, how to add to measure&amp;nbsp;random number and after RANKX() through this value.&lt;/DIV&gt;&lt;DIV&gt;I am expecting from above example something like this:&lt;BR /&gt;DDD, 8, 1&lt;/DIV&gt;&lt;DIV&gt;CCC, 7, 2&lt;/DIV&gt;&lt;DIV&gt;BBB, 6, 3&lt;/DIV&gt;&lt;DIV&gt;AAA, 5, 4&lt;/DIV&gt;&lt;DIV&gt;EEE, 4, 5&lt;/DIV&gt;&lt;DIV&gt;FFF, 4, 6&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you in advance.&lt;/DIV&gt;&lt;DIV&gt;Have a good day)&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 13 Jul 2022 06:37:46 GMT</pubDate>
    <dc:creator>vilnyts</dc:creator>
    <dc:date>2022-07-13T06:37:46Z</dc:date>
    <item>
      <title>Adding RAND() number to measure and RANKX() it</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-RAND-number-to-measure-and-RANKX-it/m-p/2635355#M77241</link>
      <description>&lt;P&gt;Hi, everyone.&lt;/P&gt;&lt;P&gt;I have a problem when i am using RANKX() function.&lt;/P&gt;&lt;P&gt;I have a one column table that contains redundant category names (AAA, BBB, CCC.....FFF) and have a measure that counts rows through a table:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;Counts = &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;COUNT(&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;'table'[Dim]&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am going to rank my rows, to do that i have a measure:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;RankRows = &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;RANKX(ALL('table'[Dim]), [Counts] ,, DESC)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;When i put those measures (rank and count) and column into a table i have the following:&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;As you can see categories EEE, FFF have the same counts and as a result the same rank.&lt;/P&gt;&lt;P&gt;I want to get rid of this, i need to get the unique rank for the each row.&lt;/P&gt;&lt;P&gt;To do that, "Counts" measure was modified a bit i added random number and expected to get correct rank, but i have this:&lt;/P&gt;&lt;img /&gt;&lt;P&gt;"Counts" was modified like this:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;Counts = &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;COUNT(&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;'table'[Dim]&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;) + DIVIDE(RAND(), 100)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Could somebody help or explain way, how to add to measure&amp;nbsp;random number and after RANKX() through this value.&lt;/DIV&gt;&lt;DIV&gt;I am expecting from above example something like this:&lt;BR /&gt;DDD, 8, 1&lt;/DIV&gt;&lt;DIV&gt;CCC, 7, 2&lt;/DIV&gt;&lt;DIV&gt;BBB, 6, 3&lt;/DIV&gt;&lt;DIV&gt;AAA, 5, 4&lt;/DIV&gt;&lt;DIV&gt;EEE, 4, 5&lt;/DIV&gt;&lt;DIV&gt;FFF, 4, 6&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you in advance.&lt;/DIV&gt;&lt;DIV&gt;Have a good day)&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 13 Jul 2022 06:37:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-RAND-number-to-measure-and-RANKX-it/m-p/2635355#M77241</guid>
      <dc:creator>vilnyts</dc:creator>
      <dc:date>2022-07-13T06:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Adding RAND() number to measure and RANKX() it</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-RAND-number-to-measure-and-RANKX-it/m-p/2635609#M77250</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please check the below measures and the attached pbix file.&lt;/P&gt;
&lt;P&gt;I suggest writing an additional measure like below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rankalphabet = 
RANKX ( ALL ( 'Table'[Dim] ), CALCULATE ( MAX ( 'Table'[Dim] ) ),, ASC ) / 100
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Counts = 
COUNT(
'Table'[Dim]
) + [Rankalphabet]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;RankRows = 
RANKX(ALL('Table'[Dim]),  [Counts],, DESC)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 08:01:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-RAND-number-to-measure-and-RANKX-it/m-p/2635609#M77250</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2022-07-13T08:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Adding RAND() number to measure and RANKX() it</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-RAND-number-to-measure-and-RANKX-it/m-p/2640322#M77500</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks a lot Jihwan_Kim, it was the solution for me.&lt;/P&gt;&lt;P&gt;Have a good day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 06:22:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-RAND-number-to-measure-and-RANKX-it/m-p/2640322#M77500</guid>
      <dc:creator>vilnyts</dc:creator>
      <dc:date>2022-07-15T06:22:29Z</dc:date>
    </item>
  </channel>
</rss>

