<?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 a Country within Continents with data at a City level using a lookup table. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2376770#M61258</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this...&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Country Ranking = 
VAR CountriesInContinent =
    CALCULATETABLE(
        VALUES(Geography[Country]),
        FILTER(
            ALL(Geography),
            Geography[Continent] = SELECTEDVALUE(Geography[Continent])
        )
    )
RETURN

RANKX(
    CountriesInContinent,
    [Park Spend %],
    [Park Spend %],
    DESC,
    Skip
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Produces these results&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;The matrix was to make sure each country was calculating correctly within its continent...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
    <pubDate>Sun, 06 Mar 2022 00:51:07 GMT</pubDate>
    <dc:creator>littlemojopuppy</dc:creator>
    <dc:date>2022-03-06T00:51:07Z</dc:date>
    <item>
      <title>Ranking a Country within Continents with data at a City level using a lookup table.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2376736#M61254</link>
      <description>&lt;P&gt;Hey, trying to solve this one for a while now. Lots of solutions that come close but don't exactly do what I need it to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data table "city data" (Month, &lt;STRONG&gt;City&lt;/STRONG&gt;, Total Spend, Park Spend) and a lookup table "lookup" (City, Country, Continent) connected on City.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to have a drop down for &lt;STRONG&gt;Country&lt;/STRONG&gt; that will update a card visual (not table) with the that &lt;STRONG&gt;Country's rank within the Continent&lt;/STRONG&gt; based on a measure - let's say Park Spend % = Sum of&amp;nbsp;Park Spend / Sum of Total Spend. This measure can change, I will use a SWITCH in my ranking solution to allow the basis metric/measure to be dynamic. For the sake of this problem let's assume I have a measure&amp;nbsp;Park Spend %.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have screenshots and a sample of the tables and goal below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance will be appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;city data&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Month&lt;/TD&gt;&lt;TD&gt;City&lt;/TD&gt;&lt;TD&gt;Total Spend&lt;/TD&gt;&lt;TD&gt;Park Spend&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;91.96&lt;/TD&gt;&lt;TD&gt;42.46&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;77.04&lt;/TD&g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54&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;lookup&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;City&lt;/TD&gt;&lt;TD&gt;Country&lt;/TD&gt;&lt;TD&gt;Continent&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;US&lt;/TD&gt;&lt;TD&gt;North America&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;US&lt;/TD&gt;&lt;TD&gt;North America&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;Canada&lt;/TD&gt;&lt;TD&gt;North America&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;Canada&lt;/TD&gt;&lt;TD&gt;North America&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;UK&lt;/TD&gt;&lt;TD&gt;Europe&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sun, 06 Mar 2022 00:12:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2376736#M61254</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-06T00:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking a Country within Continents with data at a City level using a lookup table.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2376770#M61258</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this...&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Country Ranking = 
VAR CountriesInContinent =
    CALCULATETABLE(
        VALUES(Geography[Country]),
        FILTER(
            ALL(Geography),
            Geography[Continent] = SELECTEDVALUE(Geography[Continent])
        )
    )
RETURN

RANKX(
    CountriesInContinent,
    [Park Spend %],
    [Park Spend %],
    DESC,
    Skip
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Produces these results&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;The matrix was to make sure each country was calculating correctly within its continent...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 00:51:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2376770#M61258</guid>
      <dc:creator>littlemojopuppy</dc:creator>
      <dc:date>2022-03-06T00:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking a Country within Continents with data at a City level using a lookup table.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2376781#M61261</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;How does this look? Link for report..&lt;/P&gt;&lt;P&gt;&lt;A title="Country Rank" href="https://drive.google.com/file/d/19GDshsKGvCHcrg_fbJCe1L5sn5GGSMAt/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/19GDshsKGvCHcrg_fbJCe1L5sn5GGSMAt/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 01:14:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2376781#M61261</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-03-06T01:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking a Country within Continents with data at a City level using a lookup table.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2376915#M61270</link>
      <description>&lt;P&gt;When I select UK, country rank returns 3, while it should return 1 since UK ranks 1 in Europe. Like I mentioned, I would like to see the &lt;STRONG&gt;Country Rank within it's Continent&lt;/STRONG&gt; on the card.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 10:37:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2376915#M61270</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-06T10:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking a Country within Continents with data at a City level using a lookup table.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2376923#M61275</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;please refer to the solution I posted an hour before&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="179903" data-lia-user-login="Whitewater100" class="lia-mention lia-mention-user"&gt;Whitewater100&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 11:51:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2376923#M61275</guid>
      <dc:creator>littlemojopuppy</dc:creator>
      <dc:date>2022-03-06T11:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking a Country within Continents with data at a City level using a lookup table.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2376955#M61280</link>
      <description>&lt;P&gt;Hi littlemojopuppy:&lt;/P&gt;&lt;P&gt;When I saw this quesition yesterday, no one had replied on it. I went to work on it and posted my answer as soon as I finished,&amp;nbsp; still without seeing your answer until today.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for any confusion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When did you answer and when did I, as I did my answer fairly quickly after seeing the question?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 13:18:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2376955#M61280</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-03-06T13:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking a Country within Continents with data at a City level using a lookup table.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2376966#M61281</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="179903" data-lia-user-login="Whitewater100" class="lia-mention lia-mention-user"&gt;Whitewater100&lt;/a&gt;&amp;nbsp;you posted your response an hour after I did.&amp;nbsp; I've noticed you doing this on multiple posts in the last couple weeks, both to me and to others.&amp;nbsp; There's an expectation of etiquette in the forum, where we try not to overwhelm the users with numerous responses.&amp;nbsp; Because all it does is create confusion.&amp;nbsp; It would be appreciated if you followed etiquette.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 13:32:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2376966#M61281</guid>
      <dc:creator>littlemojopuppy</dc:creator>
      <dc:date>2022-03-06T13:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking a Country within Continents with data at a City level using a lookup table.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2377198#M61303</link>
      <description>&lt;P&gt;Yes, I saw your response and am evaluating it.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 18:43:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2377198#M61303</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-06T18:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking a Country within Continents with data at a City level using a lookup table.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2377199#M61304</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="17198" data-lia-user-login="littlemojopuppy" class="lia-mention lia-mention-user"&gt;littlemojopuppy&lt;/a&gt;&amp;nbsp; Thanks for your response it does what I asked for and I can see has already been marked as the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, in my actual dataset, applying any date slicer from a connected calendar table causes the rank to&amp;nbsp; be funny when in a card but populates correctly against the country in a table. No idea why that would happen. Even if I select all on my date slicer, that is nothing is excluded, my rank in the card is wrong, But if I don't engage the slicer at all - it works fine. Do you have any thoughts?&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 18:50:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2377199#M61304</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-06T18:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking a Country within Continents with data at a City level using a lookup table.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2377242#M61308</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;how are you creating the relationship between the date table and this table?&amp;nbsp; Because the sample data you shared only has month number (and no year).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you share your pbix?&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 19:31:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ranking-a-Country-within-Continents-with-data-at-a-City-level/m-p/2377242#M61308</guid>
      <dc:creator>littlemojopuppy</dc:creator>
      <dc:date>2022-03-06T19:31:18Z</dc:date>
    </item>
  </channel>
</rss>

