<?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: Get Top2 values from each level in PowerBI and Dax in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Top2-values-from-each-level-in-PowerBI-and-Dax/m-p/962804#M11337</link>
    <description>&lt;P&gt;Could you post that source data as text? Looks like you want a dynamic RANKX measure and those are always a treat so need sample data to work with.&amp;nbsp;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;/P&gt;</description>
    <pubDate>Fri, 06 Mar 2020 21:15:45 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2020-03-06T21:15:45Z</dc:date>
    <item>
      <title>Get Top2 values from each level in PowerBI and Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Top2-values-from-each-level-in-PowerBI-and-Dax/m-p/962768#M11332</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to achive o/p like below with given dataset in PowerBi and Dax.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help.&lt;/P&gt;&lt;P&gt;Req : I need to get top 2 values dynamically in each level of hierarchy.&amp;nbsp;&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;Thanks,&lt;/P&gt;&lt;P&gt;Satya&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 20:44:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Top2-values-from-each-level-in-PowerBI-and-Dax/m-p/962768#M11332</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-06T20:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get Top2 values from each level in PowerBI and Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Top2-values-from-each-level-in-PowerBI-and-Dax/m-p/962804#M11337</link>
      <description>&lt;P&gt;Could you post that source data as text? Looks like you want a dynamic RANKX measure and those are always a treat so need sample data to work with.&amp;nbsp;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;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 21:15:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Top2-values-from-each-level-in-PowerBI-and-Dax/m-p/962804#M11337</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-06T21:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Get Top2 values from each level in PowerBI and Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Top2-values-from-each-level-in-PowerBI-and-Dax/m-p/962812#M11339</link>
      <description>&lt;P&gt;Thank you for helping &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt; . Below is sample data. Please let me know if need more details.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Area	Segment	Product	Value
A1	S1	P1	200
A1	S1	P2	100
A1	S1	P3	50
A1	S2	P2	400
A1	S2	P4	240
A1	S2	P5	310
A1	S2	P6	160
A1	S3	P3	300
A1	S3	P4	250
A2	S1	P8	150
A2	S1	P1	250
A2	S1	P6	600
A2	S2	P1	700
A2	S2	P2	100
A2	S2	P3	400
A2	S3	P4	350
A3	S1	P1	100&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 21:30:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Top2-values-from-each-level-in-PowerBI-and-Dax/m-p/962812#M11339</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-06T21:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get Top2 values from each level in PowerBI and Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Top2-values-from-each-level-in-PowerBI-and-Dax/m-p/962828#M11340</link>
      <description>&lt;P&gt;A measure&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MeRank = RANKX(
            FILTER(ALL( TableY),  TableY[Segment] = MAX(TableY[Segment]) &amp;amp;&amp;amp; TableY[Area] = MAX(TableY[Area])), 
                CALCULATE(SUM(TableY[Value])))&lt;/LI-CODE&gt;
&lt;P&gt;If you put Area, Segment, Product as Rows.&amp;nbsp; Value in Values.&lt;/P&gt;
&lt;P&gt;Add the MeRank to the Visual Filter and make it 'less than' 3&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 21:47:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Top2-values-from-each-level-in-PowerBI-and-Dax/m-p/962828#M11340</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2020-03-06T21:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get Top2 values from each level in PowerBI and Dax</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Top2-values-from-each-level-in-PowerBI-and-Dax/m-p/963346#M11370</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="81111" data-lia-user-login="HotChilli" class="lia-mention lia-mention-user"&gt;HotChilli&lt;/a&gt;thanks for the reply. tried as you suggested but i am getting the same value (as 1) for all levels.&lt;/P&gt;&lt;P&gt;Tried with below measure but i am getting top 2 values for entire segment level. But i need top2 values for each area as highlighted below. please help&lt;/P&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;TopN = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR ranks =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RANKX(CROSSJOIN(ALLSELECTED(Data[Area]),ALLSELECTED(Data[Segment])),CALCULATE(SUM(Data[Value])),,DESC,Dense) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN IF(ranks &amp;lt;= 2,SUM(Data[Value]),BLANK () )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;img /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Also tried with below measure&lt;/SPAN&gt;, but is it working only for specific level(here segment as it fixed),when i drill up/down it is not working.&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Top2_Segments = VAR&amp;nbsp; R = VALUES((Data[Segment])) Return CALCULATE([Value_M],TOPN(2,ALL(Data[Segment]),[Value_M]),R)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;Satya&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 08 Mar 2020 02:50:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Top2-values-from-each-level-in-PowerBI-and-Dax/m-p/963346#M11370</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-08T02:50:34Z</dc:date>
    </item>
  </channel>
</rss>

