<?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: Dynamic Rank Calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Rank-Calculation/m-p/5144612#M187635</link>
    <description>&lt;P&gt;Please try the measure below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Kingfisher Top 5 Markets =
COUNTROWS (
    FILTER (
        VALUES ( 'Dim Market'[MarketID] ),
        VAR _KingfisherSales =
            CALCULATE (
                [Sales],
                'Dim Brand'[Brand] = "Kingfisher"
            )
        VAR _Rank =
            RANKX (
                ALLSELECTED ( 'Dim Brand'[Brand] ),
                CALCULATE ( [Sales] ),
                _KingfisherSales,
                DESC,
                Dense
            )
        RETURN
            _Rank &amp;lt;= 5
    )
)&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 07 Apr 2026 13:09:25 GMT</pubDate>
    <dc:creator>cengizhanarslan</dc:creator>
    <dc:date>2026-04-07T13:09:25Z</dc:date>
    <item>
      <title>Dynamic Rank Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Rank-Calculation/m-p/5144577#M187632</link>
      <description>&lt;P&gt;Hi Team&lt;BR /&gt;&lt;BR /&gt;I have a model where i have Dim Market, Dim Brand and Fact Sales.&lt;BR /&gt;Market ID of Dim Market is connected to Market ID of Fact Sales&lt;BR /&gt;Brand ID of Dim Brand is connected to Brand ID of Fact Sales&lt;BR /&gt;We have a brand named "Kingfisher" in the Dim Brand&lt;BR /&gt;&lt;BR /&gt;I need to create a measure with below logic:&lt;BR /&gt;&lt;BR /&gt;Based on the slicer selection, I want the count of markets where the brand "Kingfisher" is coming on top 5 for a measure named Sales&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;In Short:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;STRONG&gt;Count the number of markets where “Kingfisher” appears in the Top 5 brands by Sales, respecting the current filter context.&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Amit&lt;/DIV&gt;</description>
      <pubDate>Tue, 07 Apr 2026 12:28:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Rank-Calculation/m-p/5144577#M187632</guid>
      <dc:creator>Amit92</dc:creator>
      <dc:date>2026-04-07T12:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Rank Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Rank-Calculation/m-p/5144588#M187633</link>
      <description>&lt;P&gt;I think you can use&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Num markets Kingfisher Top 5 =
VAR MarketsAndBrands =
    ADDCOLUMNS (
        CALCULATETABLE (
            SUMMARIZE ( Sales, Market[Market], Brand[Name] ),
            ALLSELECTED ()
        ),
        "@sales", [Sales]
    )
VAR Top5 =
    WINDOW (
        1,
        ABS,
        5,
        ABS,
        MarketsAndBrands,
        ORDERBY ( [@sales], DESC ),
        PARTITIONBY ( Market[Market] )
    )
VAR Result =
    COUNTROWS ( FILTER ( Top5, Brand[Name] = "Kingfisher" ) )
RETURN
    Result
&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 07 Apr 2026 12:40:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Rank-Calculation/m-p/5144588#M187633</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2026-04-07T12:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Rank Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Rank-Calculation/m-p/5144602#M187634</link>
      <description>&lt;P&gt;Hi John,&lt;BR /&gt;&lt;BR /&gt;Thanks for the quick help,&lt;BR /&gt;I am getting error in the above measure that the column Market[Market] specified in the 'SUMMARIZE' function was not found in the input table&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2026 12:56:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Rank-Calculation/m-p/5144602#M187634</guid>
      <dc:creator>Amit92</dc:creator>
      <dc:date>2026-04-07T12:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Rank Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Rank-Calculation/m-p/5144612#M187635</link>
      <description>&lt;P&gt;Please try the measure below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Kingfisher Top 5 Markets =
COUNTROWS (
    FILTER (
        VALUES ( 'Dim Market'[MarketID] ),
        VAR _KingfisherSales =
            CALCULATE (
                [Sales],
                'Dim Brand'[Brand] = "Kingfisher"
            )
        VAR _Rank =
            RANKX (
                ALLSELECTED ( 'Dim Brand'[Brand] ),
                CALCULATE ( [Sales] ),
                _KingfisherSales,
                DESC,
                Dense
            )
        RETURN
            _Rank &amp;lt;= 5
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 07 Apr 2026 13:09:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Rank-Calculation/m-p/5144612#M187635</guid>
      <dc:creator>cengizhanarslan</dc:creator>
      <dc:date>2026-04-07T13:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Rank Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Rank-Calculation/m-p/5144614#M187636</link>
      <description>&lt;P&gt;Change both references to Market[Market] to whichever column from your market dimension uniquely identifies a row. e.g. you could use Market[Market ID].&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2026 13:13:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Rank-Calculation/m-p/5144614#M187636</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2026-04-07T13:13:35Z</dc:date>
    </item>
  </channel>
</rss>

