<?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: Creating a Rank measure based on measure Net_Sales in Desc Order. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Rank-measure-based-on-measure-Net-Sales-in-Desc-Order/m-p/3697875#M143806</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&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;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Net Sales measure = 
VAR _netsales =
    SUM ( Data[net_sales] )
RETURN
    IF ( ISBLANK ( _netsales ), 0, _netsales )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/rank-function-dax?wt.mc_id=DP-MVP-5004989" target="_blank"&gt;RANK function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rank net sales measure =
RANK (
    SKIP,
    ALL ( Data[customer_name] ),
    ORDERBY ( [Net Sales measure], DESC )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Feb 2024 03:45:55 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2024-02-14T03:45:55Z</dc:date>
    <item>
      <title>Creating a Rank measure based on measure Net_Sales in Desc Order.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Rank-measure-based-on-measure-Net-Sales-in-Desc-Order/m-p/3697505#M143787</link>
      <description>&lt;P&gt;In my table I have columns DBA which is a list of customer names, and then NET_SALES.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created the measure: Net_Sales(m) =&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ISBLANK&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(table&lt;/SPAN&gt;&lt;SPAN&gt;[NET_SALES]&lt;/SPAN&gt;&lt;SPAN&gt;))), &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(table&lt;/SPAN&gt;&lt;SPAN&gt;[NET_SALES]&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;BR /&gt;&lt;BR /&gt;I now want to create a new measure, Rank, which ranks the Net_Sales(m) in descending order.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The issue I'm having is that when it gets to 0.00 or less, into the negatives, the ranking jumps all over in no particular order.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I aslo need to create a new measure that then looks at the Rank and divides the results into four even quads.&amp;nbsp; The top 25% of the Rank would be quad 1, the next 25% quad 2, etc.&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Feb 2024 00:24:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Rank-measure-based-on-measure-Net-Sales-in-Desc-Order/m-p/3697505#M143787</guid>
      <dc:creator>FischerEric86</dc:creator>
      <dc:date>2024-02-14T00:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Rank measure based on measure Net_Sales in Desc Order.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Rank-measure-based-on-measure-Net-Sales-in-Desc-Order/m-p/3697875#M143806</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&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;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Net Sales measure = 
VAR _netsales =
    SUM ( Data[net_sales] )
RETURN
    IF ( ISBLANK ( _netsales ), 0, _netsales )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/rank-function-dax?wt.mc_id=DP-MVP-5004989" target="_blank"&gt;RANK function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rank net sales measure =
RANK (
    SKIP,
    ALL ( Data[customer_name] ),
    ORDERBY ( [Net Sales measure], DESC )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 03:45:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Rank-measure-based-on-measure-Net-Sales-in-Desc-Order/m-p/3697875#M143806</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-02-14T03:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Rank measure based on measure Net_Sales in Desc Order.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Rank-measure-based-on-measure-Net-Sales-in-Desc-Order/m-p/3699116#M143874</link>
      <description>&lt;P&gt;Do you have a solution on how to create the last measure where it looks at the &lt;U&gt;Rank net sales measure&lt;/U&gt; and evenly divides the results into four quadrants based ona descening order?&amp;nbsp; So if there's 100 rows, the first 1-25 rows that would have the highest net sales would be labeled as Quad 1, 26-50 as Quad 2, 51-75 as Quad 3, and 76-100 as Quad 4.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 15:13:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Rank-measure-based-on-measure-Net-Sales-in-Desc-Order/m-p/3699116#M143874</guid>
      <dc:creator>FischerEric86</dc:creator>
      <dc:date>2024-02-14T15:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Rank measure based on measure Net_Sales in Desc Order.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Rank-measure-based-on-measure-Net-Sales-in-Desc-Order/m-p/3699529#M143883</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file if it suits your requirement.&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;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;expected result measure: =
VAR _all =
    COUNTROWS ( ALL ( Data[customer_name] ) )
VAR _rank = [Rank net sales measure]
RETURN
    IF (
        HASONEVALUE ( Data[customer_name] ),
        SWITCH (
            TRUE (),
            DIVIDE ( _rank, _all ) &amp;lt;= 0.25, 1,
            DIVIDE ( _rank, _all ) &amp;lt;= 0.5, 2,
            DIVIDE ( _rank, _all ) &amp;lt;= 0.75, 3,
            4
        )
    )
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 14 Feb 2024 18:33:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Rank-measure-based-on-measure-Net-Sales-in-Desc-Order/m-p/3699529#M143883</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-02-14T18:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Rank measure based on measure Net_Sales in Desc Order.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Rank-measure-based-on-measure-Net-Sales-in-Desc-Order/m-p/3699939#M143893</link>
      <description>&lt;P&gt;I've used a solution like this before and ran into the same issue I see here.&amp;nbsp; &amp;nbsp;Customer's F-S are grouped as 2, where F-K or F-I should be 2, and then K-S or I-S should be grouped as 3.&amp;nbsp; So that we have four groupings evenly split or as close to evenly split.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 01:13:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Rank-measure-based-on-measure-Net-Sales-in-Desc-Order/m-p/3699939#M143893</guid>
      <dc:creator>FischerEric86</dc:creator>
      <dc:date>2024-02-15T01:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Rank measure based on measure Net_Sales in Desc Order.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Rank-measure-based-on-measure-Net-Sales-in-Desc-Order/m-p/3699979#M143895</link>
      <description>&lt;P&gt;I created a MaxRank measure&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MaxRank =&lt;/SPAN&gt; &lt;SPAN&gt;MAXX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(table&lt;/SPAN&gt;&lt;SPAN&gt;[DBA]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;[Rank]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;TRUE&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Then another measure to take Rank / MaxRank.&amp;nbsp; This gave me my % of rank and allows me to then create a measure that groups by % of Rank into 4 quads.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 15 Feb 2024 01:48:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Creating-a-Rank-measure-based-on-measure-Net-Sales-in-Desc-Order/m-p/3699979#M143895</guid>
      <dc:creator>FischerEric86</dc:creator>
      <dc:date>2024-02-15T01:48:37Z</dc:date>
    </item>
  </channel>
</rss>

