<?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: Filtering Table Values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267586#M55045</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24978" data-lia-user-login="smpa01" class="lia-mention lia-mention-user"&gt;smpa01&lt;/a&gt;&amp;nbsp;This looks good. Can we implement this as Calculated Table with all 3 columns?&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jan 2022 15:07:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-01-05T15:07:21Z</dc:date>
    <item>
      <title>Filtering Table Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267111#M55014</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Hello All,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24978" data-lia-user-login="smpa01" class="lia-mention lia-mention-user"&gt;smpa01&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish to create a Result Table from the Data Table as seen in the attached screenshot. The Result Table must be such that it will show only those values in the three columns which are corresponding to the &lt;STRONG&gt;Maximum of Sum of Order Value&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will be helpful if we can achieve this functionality.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 10:34:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267111#M55014</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-05T10:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Table Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267122#M55015</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; , Based on what I got, a measure to be used with GUID, LPGU in visual &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sumx(summarize(Table, Table[GUID], Table[LPGU], "_sum", sum(Table[Order Value] ) ), [_sum])&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 10:28:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267122#M55015</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-01-05T10:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Table Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267134#M55017</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;I'll check now and get back soon. Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 10:31:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267134#M55017</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-05T10:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Table Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267165#M55021</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seems that doesn't work as it still fetches multiple values of LPGU, instead it must fetch single values of GUID, LPGU corresponding to Max Sum of Order Value as shown in the Result Table. Also I need to create Result Table as Data Table(not visual table).&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 10:47:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267165#M55021</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-05T10:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Table Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267297#M55024</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; , Try like&lt;/P&gt;
&lt;P&gt;sumx(summarize(Table, Table[GUID], "_sum", sum(Table[Order Value] ) ), [_sum])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this does not help&lt;BR /&gt;Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 12:09:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267297#M55024</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-01-05T12:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Table Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267328#M55027</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;This too doesn't work and I still can see multiple values of LPGU, GUID and Order Value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It needs to go like Result Table Must show filtered GUID, LPGU and Maximum of Sum of Order Value and that Sum of Order Value must be done by LPGU.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I can't present the sample data. You Can take data from the screenshot that I attached. Also keeping the data table here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;GUID&lt;/TD&gt;&lt;TD&gt;LPGU&lt;/TD&gt;&lt;TD&gt;Order Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;G21&lt;/TD&gt;&lt;TD&gt;KRTG&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;G21&lt;/TD&gt;&lt;TD&gt;KRVC&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;G21&lt;/TD&gt;&lt;TD&gt;KRTG&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;G21&lt;/TD&gt;&lt;TD&gt;KRVC&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;G21&lt;/TD&gt;&lt;TD&gt;KRPP&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;G65&lt;/TD&gt;&lt;TD&gt;KPIC&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;G65&lt;/TD&gt;&lt;TD&gt;KPIC&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;G65&lt;/TD&gt;&lt;TD&gt;KKRD&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;G65&lt;/TD&gt;&lt;TD&gt;GHCI&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;G65&lt;/TD&gt;&lt;TD&gt;GHCI&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;G76&lt;/TD&gt;&lt;TD&gt;TTCG&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;G76&lt;/TD&gt;&lt;TD&gt;TTRS&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;G76&lt;/TD&gt;&lt;TD&gt;TTDS&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;G76&lt;/TD&gt;&lt;TD&gt;TTCG&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 05 Jan 2022 12:33:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267328#M55027</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-05T12:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Table Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267545#M55042</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp; you can write a measure like this&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;_Measure = 
CALCULATE (
    CALCULATE (
        SUM ( 'Table'[Order Value] ),
        ALLEXCEPT ( 'Table', 'Table'[GUID], 'Table'[LPGU] )
    ),
    KEEPFILTERS (
        TOPN (
            1,
            FILTER ( ALLSELECTED ( 'Table' ), 'Table'[GUID] = MAX ( 'Table'[GUID] ) ),
            CALCULATE (
                SUM ( 'Table'[Order Value] ),
                ALLEXCEPT ( 'Table', 'Table'[GUID], 'Table'[LPGU] )
            ), DESC
        )
    )
)&lt;/LI-CODE&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 14:50:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267545#M55042</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2022-01-05T14:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Table Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267586#M55045</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24978" data-lia-user-login="smpa01" class="lia-mention lia-mention-user"&gt;smpa01&lt;/a&gt;&amp;nbsp;This looks good. Can we implement this as Calculated Table with all 3 columns?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 15:07:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267586#M55045</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-05T15:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Table Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267619#M55048</link>
      <description>&lt;P&gt;Assuming you have a measure for the sum of Order Value&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;SumOrderValue = SUM ( Table1[Order Value] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then we can write a measure for the top LPGU order fairly neatly:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;Top LPGU Order =
VAR TopLPGU =
    MAXX ( TOPN ( 1, ALLSELECTED ( Table1[LPGU] ), [SumOrderValue] ), Table1[LPGU] )
RETURN
    CALCULATE ( [SumOrderValue], KEEPFILTERS ( Table1[LPGU] = TopLPGU ) )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Edit:&lt;/STRONG&gt; You can easily make this into a calculated table as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;SUMMARIZECOLUMNS ( Table1[GUID], Table1[LPGU], "Order Value", [Top LPGU Order] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 15:48:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267619#M55048</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-01-05T15:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Table Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267674#M55051</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp; this will be table expression&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 = 
var _grp = GROUPBY('Table','Table'[GUID],'Table'[LPGU],"subTotal by GUIDLPGU",SUMX(CURRENTGROUP(),'Table'[Order Value]))
--var _filt = TOPN(1, FILTER(_grp,var _guid = [GUID] return [GUID]=_guid),[x],DESC)
var _rank = SUMMARIZE(FILTER(ADDCOLUMNS(_grp, "rank", RANKX(FILTER(_grp,[GUID]=EARLIER([GUID])),[subTotal by GUIDLPGU],,DESC)),[rank]=1),[GUID],[LPGU],[subTotal by GUIDLPGU])
return _rank&lt;/LI-CODE&gt;
&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="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp; in a table expression is it possible to ask TOPN to return TOPN(1) based on a partiton like in RANKX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;RANKX(FILTER(_grp,[GUID]=EARLIER([GUID])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried but failed.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 15:37:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267674#M55051</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2022-01-05T15:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Table Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267721#M55059</link>
      <description>&lt;P&gt;I'm not quite sure what you mean but you can simplify your _rank variable to be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;FILTER (
    _grp,
    RANKX (
        FILTER ( _grp, [GUID] = EARLIER ( Table1[GUID] ) ),
        [subTotal by GUIDLPGU]
    ) = 1
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;TOPN (
    1,
    _grp,
    RANKX (
        FILTER ( _grp, [GUID] = EARLIER ( Table1[GUID] ) ),
        [subTotal by GUIDLPGU]
    ), ASC
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 16:01:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267721#M55059</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-01-05T16:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Table Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267727#M55060</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;Thanks.&amp;nbsp; I was not asking you about RANKX. I was wondering if it is possible to pass on a partitoned table in TOPN like I did in RANKX?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can I pass on a similar table like following in TOPN, so that TOPN (1) gives me thre result for that partiton?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;RANKX (
        FILTER ( _grp, [GUID] = EARLIER ( Table1[GUID] ) )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 16:00:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267727#M55060</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2022-01-05T16:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Table Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267759#M55062</link>
      <description>&lt;P&gt;Sorry, I'm still not sure I understand what you mean by "pass a partitioned table".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you try to write this&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;TOPN ( 1, FILTER ( _grp, [GUID] = EARLIER ( Table1[GUID] ) ), [...] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;it just doesn't make any sense because there's no earlier row context to refer to.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 16:16:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-Table-Values/m-p/2267759#M55062</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-01-05T16:16:37Z</dc:date>
    </item>
  </channel>
</rss>

