<?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: Measure Ranking and Aggregations in Quick Measures Gallery</title>
    <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Measure-Ranking-and-Aggregations/m-p/503563#M205</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="79230" data-lia-user-login="aardhala" class="lia-mention lia-mention-user"&gt;aardhala&lt;/a&gt; - In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick/ba-p/279563" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick/ba-p/279563&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Aug 2018 13:08:55 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2018-08-30T13:08:55Z</dc:date>
    <item>
      <title>Measure Ranking and Aggregations</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Measure-Ranking-and-Aggregations/m-p/498802#M198</link>
      <description>&lt;P&gt;There have been a lot of posts over the years about how to use RANKX to create a measure, but not so many about how to use RANKX to create a measure that ranks a measure. In addition, nothing really definitive on how to aggregate measures. This post is intended to fix that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Essentially, a measure is created via the following formula:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Measure = SUM(Table1[Column2])/SUM(Table1[Column3])&lt;/PRE&gt;
&lt;P&gt;A simple approach to creating a ranking of this measure does not work very well (notice that there are 2 "Two" rows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Measure Rank (BAD) = RANKX(ALL(Table1),[Measure])&lt;/PRE&gt;
&lt;P&gt;Therefore, a slightly more complex approach is required:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Measure Rank = 
VAR __current = CALCULATE(MAX([Column1]))
VAR __table = SUMMARIZE(ALL(Table1),[Column1],"__Measure",[Measure])
VAR __table1 = ADDCOLUMNS(__table,"__Rank",RANKX(__table,[__Measure]))
RETURN MAXX(FILTER(__table1,[Column1]=__current),[__Rank])&lt;/PRE&gt;
&lt;P&gt;For good "measure", I have included aggregations of measures, which utilize a very similar technique:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Measure StdDev = 
VAR __table = SUMMARIZE(Table1,[Column1],"__Measure",[Measure])
RETURN STDEVX.P(__table,[__Measure]) &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="reportid hidden"&gt;eyJrIjoiNDU2MWI3YTUtZWIxZi00MDQ0LTgzNDAtNDA5NWUxM2YyODQwIiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 17:50:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Measure-Ranking-and-Aggregations/m-p/498802#M198</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2018-08-24T17:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Ranking and Aggregations</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Measure-Ranking-and-Aggregations/m-p/502560#M202</link>
      <description>&lt;P&gt;Very nice concept Greg. Definitely I would like to try it out. Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 15:08:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Measure-Ranking-and-Aggregations/m-p/502560#M202</guid>
      <dc:creator>aardhala</dc:creator>
      <dc:date>2018-08-29T15:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Ranking and Aggregations</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Measure-Ranking-and-Aggregations/m-p/503109#M204</link>
      <description>&lt;P&gt;Hi Greg, I tried this expression out and got the Dynamic Rank calculated. But I coudn't use it as a Dimension. means, I couldn't use it on axis as a Dimension of a Bar Chart. Is there any way that we use such expression to build a dynamic Dimension ?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 07:24:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Measure-Ranking-and-Aggregations/m-p/503109#M204</guid>
      <dc:creator>aardhala</dc:creator>
      <dc:date>2018-08-30T07:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Ranking and Aggregations</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Measure-Ranking-and-Aggregations/m-p/503563#M205</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="79230" data-lia-user-login="aardhala" class="lia-mention lia-mention-user"&gt;aardhala&lt;/a&gt; - In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick/ba-p/279563" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick/ba-p/279563&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 13:08:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Measure-Ranking-and-Aggregations/m-p/503563#M205</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2018-08-30T13:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Ranking and Aggregations</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Measure-Ranking-and-Aggregations/m-p/715552#M353</link>
      <description>&lt;P&gt;This is awesome, and so streamlined! Could one use similar code to calculate a percentile (like PERCENTRANK in Excel)? What would that look like? I've been trying to implement something like this with DAX and it's becoming way too memory intensive.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2019 20:51:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Measure-Ranking-and-Aggregations/m-p/715552#M353</guid>
      <dc:creator>alissa</dc:creator>
      <dc:date>2019-06-14T20:51:40Z</dc:date>
    </item>
  </channel>
</rss>

