<?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 nth largest value based on other column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/get-nth-largest-value-based-on-other-column/m-p/3306128#M123479</link>
    <description>&lt;P&gt;This is way easy than the dax i wrote. Thanks a lot&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jun 2023 11:37:20 GMT</pubDate>
    <dc:creator>vamsi_tiger</dc:creator>
    <dc:date>2023-06-28T11:37:20Z</dc:date>
    <item>
      <title>get nth largest value based on other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/get-nth-largest-value-based-on-other-column/m-p/3293186#M122623</link>
      <description>&lt;P&gt;i have a table as below&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;date&lt;/TD&gt;&lt;TD&gt;reason&lt;/TD&gt;&lt;TD&gt;duration&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;23/6&lt;/TD&gt;&lt;TD&gt;breakdown&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;24/6&lt;/TD&gt;&lt;TD&gt;snacks&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;22/6&lt;/TD&gt;&lt;TD&gt;breakdown&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/6&lt;/TD&gt;&lt;TD&gt;shutdown&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/6&lt;/TD&gt;&lt;TD&gt;other&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;24/6&lt;/TD&gt;&lt;TD&gt;other&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;24/6&lt;/TD&gt;&lt;TD&gt;break&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;so if the select the time slicer on the page to 21 to 24 it should filter the values in the table to that time line and aggregate the duration of that perticualar reason and sort is as per the total duration and give me the reason.&amp;nbsp;&lt;BR /&gt;so lets say i need 2nd largest reason with respect to selected duration(eample 21-24 considering total table as above) the measure should give me "snacks" since it has 10 min&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="38415" data-lia-user-login="power" class="lia-mention lia-mention-user"&gt;power&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="2757" data-lia-user-login="PowerBI" class="lia-mention lia-mention-user"&gt;PowerBI&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="272177" data-lia-user-login="PBCommunity" class="lia-mention lia-mention-user"&gt;PBCommunity&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 12:18:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/get-nth-largest-value-based-on-other-column/m-p/3293186#M122623</guid>
      <dc:creator>vamsi_tiger</dc:creator>
      <dc:date>2023-06-20T12:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: get nth largest value based on other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/get-nth-largest-value-based-on-other-column/m-p/3293343#M122638</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="571953" data-lia-user-login="vamsi_tiger" class="lia-mention lia-mention-user"&gt;vamsi_tiger&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please refer to attached sample file with the proposed solution&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;nth Largest Reason = 
MAXX ( 
    TOPN (
        1,
        TOPN ( 
            SELECTEDVALUE ( 'nth Largest'[n] ),
            SUMMARIZE ( 
                'Table',
                'Table'[reason],
                "@Duration", SUM ( 'Table'[duration] )
            ),
            [@Duration]
        ),
        [@Duration],
        ASC
    ),
    'Table'[reason]
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;Title = 
VAR n = SELECTEDVALUE ( 'nth Largest'[n] )
RETURN
    n &amp;amp; SWITCH ( n, 1, "st", 2, "nd", 3, "rd", "th" ) &amp;amp; " Largest Reson"&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 20 Jun 2023 13:31:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/get-nth-largest-value-based-on-other-column/m-p/3293343#M122638</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-06-20T13:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: get nth largest value based on other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/get-nth-largest-value-based-on-other-column/m-p/3306128#M123479</link>
      <description>&lt;P&gt;This is way easy than the dax i wrote. Thanks a lot&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 11:37:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/get-nth-largest-value-based-on-other-column/m-p/3306128#M123479</guid>
      <dc:creator>vamsi_tiger</dc:creator>
      <dc:date>2023-06-28T11:37:20Z</dc:date>
    </item>
  </channel>
</rss>

