<?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: ranking in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ranking/m-p/3166071#M113880</link>
    <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="366933" data-lia-user-login="daniel_ricardo" class="lia-mention lia-mention-user"&gt;daniel_ricardo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try to provide some sample data?&lt;/P&gt;</description>
    <pubDate>Fri, 31 Mar 2023 14:10:52 GMT</pubDate>
    <dc:creator>FreemanZ</dc:creator>
    <dc:date>2023-03-31T14:10:52Z</dc:date>
    <item>
      <title>ranking</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ranking/m-p/3164044#M113718</link>
      <description>&lt;P&gt;I need to rank sellers based on a field that is not being filtered in the visual, just by the team that the seller belongs. It's a report made to the seller, so he must see his position among sellers on the same team. Each seller can have more than one account, that's my lowest level of glanularity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to solve the seller position in all teams, but not in his own team.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the last dax i tried:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;    RANKX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;        ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;account[seller]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;BR /&gt;        [sales_amount]&lt;BR /&gt;&lt;SPAN&gt;        ,,, &lt;/SPAN&gt;&lt;SPAN&gt;Dense&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;    ),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;    KEEPFILTERS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;fact[store_id]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;BR /&gt;    &lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;account[team]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;account[cluster]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 30 Mar 2023 17:31:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ranking/m-p/3164044#M113718</guid>
      <dc:creator>daniel_ricardo</dc:creator>
      <dc:date>2023-03-30T17:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: ranking</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ranking/m-p/3164944#M113791</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="366933" data-lia-user-login="daniel_ricardo" class="lia-mention lia-mention-user"&gt;daniel_ricardo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;not sure if i fully get you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;supposing you have table like this:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Team&lt;/TD&gt;&lt;TD&gt;Seller&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;A1&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;A2&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;B1&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;B2&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;B3&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try to plot a measure with columns [team] and [seller] and a measure like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RankingMeasure = 
RANKX(
    FILTER(
        ALL(TableName),
        TableName[Team] = MAX(TableName[Team])
    ),
    CALCULATE(SUM(TableName[Sales])),
    ,ASC
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RankingMeasure2 = 
RANKX(
    CALCULATETABLE(
        TableName,
        ALLEXCEPT(TableName, TableName[Team])
    ),
    CALCULATE(SUM(TableName[Sales])),
    ,ASC
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it worked like:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 06:00:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ranking/m-p/3164944#M113791</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-03-31T06:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: ranking</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ranking/m-p/3164947#M113792</link>
      <description>&lt;P&gt;or you add a calculated column like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RankingColumn = 
RANKX(
    FILTER(
        TableName,
        TableName[Team] = EARLIER(TableName[Team])
    ),
    TableName[Sales],
    ,ASC
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it worked like:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 06:01:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ranking/m-p/3164947#M113792</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-03-31T06:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: ranking</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ranking/m-p/3166045#M113875</link>
      <description>&lt;P&gt;Yes, your suggestion works in a table, but i'm using that measure in a card. In table, i think in some way we have a implicity filter behavior, because the team column is there (sorry if I'm saying something wrong). In my report I have a filter by seller, and the team is not filtered. I tested here and in this scenario it didn't work.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 13:58:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ranking/m-p/3166045#M113875</guid>
      <dc:creator>daniel_ricardo</dc:creator>
      <dc:date>2023-03-31T13:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: ranking</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ranking/m-p/3166071#M113880</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="366933" data-lia-user-login="daniel_ricardo" class="lia-mention lia-mention-user"&gt;daniel_ricardo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try to provide some sample data?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 14:10:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ranking/m-p/3166071#M113880</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-03-31T14:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: ranking</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ranking/m-p/3180303#M114963</link>
      <description>&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;04-03-2023&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;10:29 AM&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Sorry, I can´t share because some data privacy, but if it helps here is the data model with relevant fields to my expression. We need to get the ranking position by&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;des_gestor&lt;/EM&gt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;segmento&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;dim_agencia&lt;/EM&gt;.&lt;EM&gt;porte_agencia&lt;/EM&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;chave_ua_cart&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is the lowest level&lt;BR /&gt;&lt;EM&gt;des_gestor&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(seller) can be present in more than one chave_ua_cart&lt;BR /&gt;&lt;EM&gt;des_gestor&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;can work in more than one&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;segmento&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;but must be part of one single&amp;nbsp;&lt;EM&gt;dim_agencia&lt;/EM&gt;.porte_agencia&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 10 Apr 2023 18:54:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ranking/m-p/3180303#M114963</guid>
      <dc:creator>daniel_ricardo</dc:creator>
      <dc:date>2023-04-10T18:54:17Z</dc:date>
    </item>
  </channel>
</rss>

