<?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: TOP N with condition on another measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOP-N-with-condition-on-another-measure/m-p/2144456#M49324</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="44247" data-lia-user-login="VGuichard" class="lia-mention lia-mention-user"&gt;VGuichard&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try this code to create a new table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Table 2 =
VAR _A =
    FILTER (
        SUMMARIZE (
            'Table',
            'Table'[Product],
            "Sum(QTY)", SUM ( 'Table'[QTY] ),
            "Average(Note)", AVERAGE ( 'Table'[Note] )
        ),
        [Sum(QTY)] &amp;gt; 50
    )
RETURN
    ADDCOLUMNS ( _A, "rank", RANKX ( _A, [Average(Note)],, DESC ) )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output:&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;Or if you need all Products in the new table, use this code:&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Table 2 =
VAR _A =
    SUMMARIZE (
        'Table',
        'Table'[Product],
        "Sum(QTY)", SUM ( 'Table'[QTY] ),
        "Average(Note)", AVERAGE ( 'Table'[Note] )
    )
RETURN
    ADDCOLUMNS (
        _A,
        "rank",
            IF (
                [Sum(QTY)] &amp;gt; 50,
                RANKX ( FILTER ( _A, [Sum(QTY)] &amp;gt; 50 ), [Average(Note)],, DESC ),
                BLANK ()
            )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;STRONG&gt;accepting&lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;it as the solution&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;to help the other members find it more quickly.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Oct 2021 02:02:32 GMT</pubDate>
    <dc:creator>VahidDM</dc:creator>
    <dc:date>2021-10-20T02:02:32Z</dc:date>
    <item>
      <title>TOP N with condition on another measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOP-N-with-condition-on-another-measure/m-p/2144189#M49316</link>
      <description>&lt;P&gt;Hello Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need your help, because&amp;nbsp; I a have a fact table like this :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I need to identify the product with the best average "Note", but only with products sold over to 50 units (sum of quantity).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the summarize/addcolumns, it's easy to retrieve for each product the both information : "average note" &amp;amp; "total quantity":&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;As, you can see, the TOP1 Product, with the best average note AND with more of 50 units sold is Product C.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please, can you help me to find the correct formula to apply the top 1 on the "Summarize table" but with the filter on the "Total Quantity"&amp;nbsp; (or another method...) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For information, I have a fact table with a lot of dimension (date, product, region, Supplier etc...) and the formula need to work with all slicer in the report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 21:42:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOP-N-with-condition-on-another-measure/m-p/2144189#M49316</guid>
      <dc:creator>VGuichard</dc:creator>
      <dc:date>2021-10-19T21:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: TOP N with condition on another measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOP-N-with-condition-on-another-measure/m-p/2144456#M49324</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="44247" data-lia-user-login="VGuichard" class="lia-mention lia-mention-user"&gt;VGuichard&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try this code to create a new table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Table 2 =
VAR _A =
    FILTER (
        SUMMARIZE (
            'Table',
            'Table'[Product],
            "Sum(QTY)", SUM ( 'Table'[QTY] ),
            "Average(Note)", AVERAGE ( 'Table'[Note] )
        ),
        [Sum(QTY)] &amp;gt; 50
    )
RETURN
    ADDCOLUMNS ( _A, "rank", RANKX ( _A, [Average(Note)],, DESC ) )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output:&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;Or if you need all Products in the new table, use this code:&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Table 2 =
VAR _A =
    SUMMARIZE (
        'Table',
        'Table'[Product],
        "Sum(QTY)", SUM ( 'Table'[QTY] ),
        "Average(Note)", AVERAGE ( 'Table'[Note] )
    )
RETURN
    ADDCOLUMNS (
        _A,
        "rank",
            IF (
                [Sum(QTY)] &amp;gt; 50,
                RANKX ( FILTER ( _A, [Sum(QTY)] &amp;gt; 50 ), [Average(Note)],, DESC ),
                BLANK ()
            )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;STRONG&gt;accepting&lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;it as the solution&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;to help the other members find it more quickly.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 02:02:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOP-N-with-condition-on-another-measure/m-p/2144456#M49324</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-10-20T02:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: TOP N with condition on another measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOP-N-with-condition-on-another-measure/m-p/2146370#M49399</link>
      <description>&lt;P&gt;Thank you Vahid. I just added a filter (Rank = 1 =&amp;gt; in order to push the TOP1 Product in a card) and an "allselected" to update the ranking according to the use of a slicer product.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 17:35:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOP-N-with-condition-on-another-measure/m-p/2146370#M49399</guid>
      <dc:creator>VGuichard</dc:creator>
      <dc:date>2021-10-20T17:35:12Z</dc:date>
    </item>
  </channel>
</rss>

