<?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 Rank categories with duplicate categories in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-categories-with-duplicate-categories/m-p/2568382#M73251</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to rank the column Group Category by Start Date for each Incident Number. I've used the RANKX formula, but I don't get the result I need.&lt;/P&gt;&lt;P&gt;I need my rank to look like below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated!&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jun 2022 07:58:36 GMT</pubDate>
    <dc:creator>ruxandraalina</dc:creator>
    <dc:date>2022-06-09T07:58:36Z</dc:date>
    <item>
      <title>Rank categories with duplicate categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-categories-with-duplicate-categories/m-p/2568382#M73251</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to rank the column Group Category by Start Date for each Incident Number. I've used the RANKX formula, but I don't get the result I need.&lt;/P&gt;&lt;P&gt;I need my rank to look like below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated!&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 07:58:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-categories-with-duplicate-categories/m-p/2568382#M73251</guid>
      <dc:creator>ruxandraalina</dc:creator>
      <dc:date>2022-06-09T07:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Rank categories with duplicate categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-categories-with-duplicate-categories/m-p/2568910#M73285</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="365018" data-lia-user-login="ruxandraalina" class="lia-mention lia-mention-user"&gt;ruxandraalina&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I don't think there is a simple solution for this. The problem is that you want the count to increase by 1 everytime the group category changes which is not&amp;nbsp; a conventional requirement. However, this is a sample file with the solution&amp;nbsp;&lt;A href="https://www.dropbox.com/t/bf4kLtD0RgWQpoWh" target="_blank"&gt;https://www.dropbox.com/t/bf4kLtD0RgWQpoWh&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This requires creating two calculated columns (it can be done with one column but would be too complex to implement)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Rank = 
VAR IncidentTable = 
    CALCULATETABLE ( Incidents, ALLEXCEPT ( Incidents, Incidents[IncidentNumber] ) )
VAR IncidentCategoryTable = 
    CALCULATETABLE ( Incidents, ALLEXCEPT ( Incidents, Incidents[IncidentNumber], Incidents[Group Category] ) )
VAR UniqueDateTime = 
    Incidents[StartDate] + Incidents[EndDate_custom]
VAR Rank1 = 
    RANKX ( IncidentTable, Incidents[StartDate] + Incidents[EndDate_custom],, ASC ) 
VAR Rank2 =
    RANKX ( IncidentCategoryTable, Incidents[StartDate] + Incidents[EndDate_custom],, ASC ) 
RETURN
    Rank1 - Rank2&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Group Category  Rank = 
VAR IncidentTable =
    CALCULATETABLE ( Incidents, ALLEXCEPT ( Incidents, Incidents[IncidentNumber] ) )
VAR UniqueDate = Incidents[StartDate] + Incidents[EndDate_custom]
VAR PrevuiousTable =
    FILTER ( IncidentTable, Incidents[StartDate] + Incidents[EndDate_custom] &amp;lt;= UniqueDate )
VAR Ranks = 
    SELECTCOLUMNS ( PrevuiousTable, "@Rank", Incidents[Rank] )
RETURN
    COUNTROWS ( DISTINCT ( Ranks ) )&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 09 Jun 2022 10:43:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-categories-with-duplicate-categories/m-p/2568910#M73285</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-06-09T10:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rank categories with duplicate categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-categories-with-duplicate-categories/m-p/2570882#M73423</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;Unfortunately the second formula is simply not loading. I've tried on two different laptops, one with 8 GM RAM and another one with 16 and it's "working on it" for hours. I've tried restarting and refreshing everything multiple times, but with the same result.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, thanks a lot!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 07:11:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-categories-with-duplicate-categories/m-p/2570882#M73423</guid>
      <dc:creator>ruxandraalina</dc:creator>
      <dc:date>2022-06-10T07:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Rank categories with duplicate categories</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-categories-with-duplicate-categories/m-p/2571243#M73442</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="365018" data-lia-user-login="ruxandraalina" class="lia-mention lia-mention-user"&gt;ruxandraalina&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is indeed heavy. I'm not sure if I can find another way to calculate this but I will try. I'll let you know if I was able to find something.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 08:49:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-categories-with-duplicate-categories/m-p/2571243#M73442</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-06-10T08:49:05Z</dc:date>
    </item>
  </channel>
</rss>

