<?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: RankX function across multiple Dimension Tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RankX-function-across-multiple-Dimension-Tables/m-p/1305956#M22687</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="135733" data-lia-user-login="abhiram342" class="lia-mention lia-mention-user"&gt;abhiram342&lt;/a&gt;&amp;nbsp;- You may find this helpful.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/To-Bleep-with-RANKX/m-p/1042520#M452" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/To-Bleep-with-RANKX/m-p/1042520#M452&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise,&amp;nbsp;Not really enough information to go on, please first check if your issue is a common issue listed here: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The most important parts are:&lt;BR /&gt;1. Sample data as text, use the table tool in the editing bar&lt;BR /&gt;2. Expected output from sample data&lt;BR /&gt;3. Explanation in words of how to get from 1. to 2.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Aug 2020 04:37:13 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2020-08-19T04:37:13Z</dc:date>
    <item>
      <title>RankX function across multiple Dimension Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RankX-function-across-multiple-Dimension-Tables/m-p/1305913#M22682</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two dimension tables and one fact table . I have Product Table (Dimension) , Customer Table ( Dimesnion)&amp;nbsp; and Sales table (Fact). For Each Product, I would like display Top 3 Customer based on Sales.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output is Table Chart:&lt;/P&gt;&lt;P&gt;Product A&amp;nbsp; &amp;nbsp;Customer1 $100&lt;/P&gt;&lt;P&gt;ProductA&amp;nbsp; &amp;nbsp; Customer2&amp;nbsp; $200&lt;/P&gt;&lt;P&gt;ProductA&amp;nbsp; &amp;nbsp;Cusotmer3&amp;nbsp; $300&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help how to acheive using DAX in Power BI&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhiram&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 03:41:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RankX-function-across-multiple-Dimension-Tables/m-p/1305913#M22682</guid>
      <dc:creator>abhiram342</dc:creator>
      <dc:date>2020-08-19T03:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: RankX function across multiple Dimension Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RankX-function-across-multiple-Dimension-Tables/m-p/1305920#M22684</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="135733" data-lia-user-login="abhiram342" class="lia-mention lia-mention-user"&gt;abhiram342&lt;/a&gt; , refer this&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/" target="_blank"&gt;https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Rank Refer these links&lt;BR /&gt;&lt;A href="https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures" target="_blank"&gt;https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns" target="_blank"&gt;https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale" target="_blank"&gt;https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 03:51:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RankX-function-across-multiple-Dimension-Tables/m-p/1305920#M22684</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-08-19T03:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: RankX function across multiple Dimension Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RankX-function-across-multiple-Dimension-Tables/m-p/1305956#M22687</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="135733" data-lia-user-login="abhiram342" class="lia-mention lia-mention-user"&gt;abhiram342&lt;/a&gt;&amp;nbsp;- You may find this helpful.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/To-Bleep-with-RANKX/m-p/1042520#M452" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/To-Bleep-with-RANKX/m-p/1042520#M452&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise,&amp;nbsp;Not really enough information to go on, please first check if your issue is a common issue listed here: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The most important parts are:&lt;BR /&gt;1. Sample data as text, use the table tool in the editing bar&lt;BR /&gt;2. Expected output from sample data&lt;BR /&gt;3. Explanation in words of how to get from 1. to 2.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 04:37:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RankX-function-across-multiple-Dimension-Tables/m-p/1305956#M22687</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-08-19T04:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: RankX function across multiple Dimension Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RankX-function-across-multiple-Dimension-Tables/m-p/1306047#M22691</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="135733" data-lia-user-login="abhiram342" class="lia-mention lia-mention-user"&gt;abhiram342&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use this measure&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Top 3 = 
SWITCH(
    TRUE(),
    ISINSCOPE(Customer[Name]), RANKX(ALL('Customer'[Name]),[Total Sales]),
    ISINSCOPE('Item'[Brand]), RANKX(ALL('Item'[Brand]), [Total Sales])
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a Visual Filter where Top3 is less than 3.&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;P&gt;Regards,&lt;BR /&gt;Harsh Nathani&lt;BR /&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 05:32:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RankX-function-across-multiple-Dimension-Tables/m-p/1306047#M22691</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-19T05:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: RankX function across multiple Dimension Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RankX-function-across-multiple-Dimension-Tables/m-p/1306088#M22692</link>
      <description>&lt;P&gt;Thanks Harsh ! I have replaced with actual tables and the DAX code is runnig for more than 10 mins . Can you please suggest if we have any alternatives&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhiram&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 05:48:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RankX-function-across-multiple-Dimension-Tables/m-p/1306088#M22692</guid>
      <dc:creator>abhiram342</dc:creator>
      <dc:date>2020-08-19T05:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: RankX function across multiple Dimension Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RankX-function-across-multiple-Dimension-Tables/m-p/1306173#M22695</link>
      <description>&lt;P&gt;Thanks Amit ! I referred to below blog and using measure simialr to this but da code take long time&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;Top 3 =&lt;BR /&gt;SWITCH(&lt;BR /&gt;TRUE(),&lt;BR /&gt;ISINSCOPE(Customer[Name]), RANKX(ALL('Customer'[Name]),[Total Sales]),&lt;BR /&gt;ISINSCOPE('Item'[Brand]), RANKX(ALL('Item'[Brand]), [Total Sales])&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhiram&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 06:11:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RankX-function-across-multiple-Dimension-Tables/m-p/1306173#M22695</guid>
      <dc:creator>abhiram342</dc:creator>
      <dc:date>2020-08-19T06:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: RankX function across multiple Dimension Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RankX-function-across-multiple-Dimension-Tables/m-p/1307715#M22744</link>
      <description>&lt;LI-CODE lang="csharp"&gt;// Create a measure that for each
// customer will tell you if
// they are in the top 3 cust for
// a product or not. Then use the measure
// as a filter for a table visual that will
// show you the existing combinations
// of Product and Customer and will display
// the [Total Sales] measure. Filter the
// visual by [Filtering Measure] = 1.

[Filtering Measure] =
var __oneProductAndCustomerVisible =
    HASONEVALUE( Customer[CustID] )
    &amp;amp;&amp;amp; HASONEVALUE( Product[ProdID] )
var __result =
    if(
        __oneProductAndCustomerVisible,
        var __top3Customers =
            CALCULATE(
                // Bear in mind that if there
                // are ties with respect to
                // [Total Sales], all the qualified
                // customers will be returned, so
                // there might be more than 3.
                topn(3,
                    VALUES( Customer[CustId] ),
                    [Total Sales],
                    DESC
                ),
                ALL( Customer )
            )
        var __currentCustInTop3 =
            VALUES( Customer[CustID] )
            in __top3Customers
        return
            1 * __currentCustInTop3
    )
return
    __result&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 19 Aug 2020 14:02:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RankX-function-across-multiple-Dimension-Tables/m-p/1307715#M22744</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-19T14:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: RankX function across multiple Dimension Tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RankX-function-across-multiple-Dimension-Tables/m-p/1308278#M22775</link>
      <description>&lt;P&gt;Thanks daxer ! I'm gettng error in below&amp;nbsp; part of code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Funciton expects table expression for argument but string was used&lt;/P&gt;&lt;P&gt;var __currentCustInTop3 =&lt;BR /&gt;VALUES( Customer[CustID] )&lt;BR /&gt;in __top3Customers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhiram&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2020 17:02:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/RankX-function-across-multiple-Dimension-Tables/m-p/1308278#M22775</guid>
      <dc:creator>abhiram342</dc:creator>
      <dc:date>2020-08-19T17:02:32Z</dc:date>
    </item>
  </channel>
</rss>

