<?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: Count TOP N for each Legend items that are Displayed on Graph in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-TOP-N-for-each-Legend-items-that-are-Displayed-on-Graph/m-p/2534284#M71170</link>
    <description>&lt;P&gt;Thank you. This worked. Turns out we needed to add the filter to the DAX equation.&lt;/P&gt;</description>
    <pubDate>Mon, 23 May 2022 19:41:09 GMT</pubDate>
    <dc:creator>cmaloyb</dc:creator>
    <dc:date>2022-05-23T19:41:09Z</dc:date>
    <item>
      <title>Count TOP N for each Legend items that are Displayed on Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-TOP-N-for-each-Legend-items-that-are-Displayed-on-Graph/m-p/2520949#M70276</link>
      <description>&lt;P&gt;I am trying to create a card that will display the number of Top N items based on a category. Please consider the bar graph below.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to display two Card visuals above the chart that gives a total of the Top 5 Equipment that has the most maintenance jobs. This is the table (partial) used to create this visual along with the filters:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The desired result on each card would total up the number of maintenance jobs pertaining to each Equipment Responsibility. The Aerospace Engineer card would display 144 whereas the Electrical Engineer card would display 230. I would like for this to be dynamic as well if there were to have slicers on the report (Airplane type from a future data table). I created a card using the Count of Job Number field and filtering that visual for Top 5 Count of Job number and then by Equipment Responsibility, however it will total the top 5 Electrical Engineer job number's, for example.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried writing a DAX formula, but to be fairly honest, I'm having trouble understanding the TOPN function and am even wondering if I'm even going the right direction.&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 14:48:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-TOP-N-for-each-Legend-items-that-are-Displayed-on-Graph/m-p/2520949#M70276</guid>
      <dc:creator>cmaloyb</dc:creator>
      <dc:date>2022-05-17T14:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Count TOP N for each Legend items that are Displayed on Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-TOP-N-for-each-Legend-items-that-are-Displayed-on-Graph/m-p/2521042#M70287</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="215885" data-lia-user-login="cmaloyb" class="lia-mention lia-mention-user"&gt;cmaloyb&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please try&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Top 5 Engineers =
SUMX (
    TOPN (
        5,
        ADDCOLUMNS (
            VALUES ( TableName[Equipment Responsibilty] ),
            "@Count", CALCULATE ( DISTINCTCOUNT ( TableName[Job Number] ) )
        ),
        [@Count]
    ),
    [@Count]
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;Top 5 Equipment =
SUMX (
    TOPN (
        5,
        ADDCOLUMNS (
            VALUES ( TableName[Equipment] ),
            "@Count", CALCULATE ( DISTINCTCOUNT ( TableName[Job Number] ) )
        ),
        [@Count]
    ),
    [@Count]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 15:23:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-TOP-N-for-each-Legend-items-that-are-Displayed-on-Graph/m-p/2521042#M70287</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-17T15:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Count TOP N for each Legend items that are Displayed on Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-TOP-N-for-each-Legend-items-that-are-Displayed-on-Graph/m-p/2521082#M70292</link>
      <description>&lt;P&gt;The second DAX Function seems to give me the correct total, however when filtering Engineer Responsibility, it give the sum of the top 5 for that selected Engineer Responsibility instead of the 3 that are displayed on the visual. Below, I have provided an idea of what I would potentially like for my card visuals to read.&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 15:39:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-TOP-N-for-each-Legend-items-that-are-Displayed-on-Graph/m-p/2521082#M70292</guid>
      <dc:creator>cmaloyb</dc:creator>
      <dc:date>2022-05-17T15:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Count TOP N for each Legend items that are Displayed on Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-TOP-N-for-each-Legend-items-that-are-Displayed-on-Graph/m-p/2522312#M70394</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="215885" data-lia-user-login="cmaloyb" class="lia-mention lia-mention-user"&gt;cmaloyb&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Would you please explain in further details?&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 06:44:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-TOP-N-for-each-Legend-items-that-are-Displayed-on-Graph/m-p/2522312#M70394</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-18T06:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Count TOP N for each Legend items that are Displayed on Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-TOP-N-for-each-Legend-items-that-are-Displayed-on-Graph/m-p/2523495#M70473</link>
      <description>&lt;P&gt;When using this code.....&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Top 5 Equipment =
SUMX (
    TOPN (
        5,
        ADDCOLUMNS (
            VALUES ( TableName[Equipment] ),
            "@Count", CALCULATE ( DISTINCTCOUNT ( TableName[Job Number] ) )
        ),
        [@Count]
    ),
    [@Count]
)&lt;/LI-CODE&gt;&lt;P&gt;I was able to get "Top 5 Equipment" total of 374.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I use "Equipment Responsibility" visual level filter on the "Top 5 Equipment" card, it filters for the TOP5 of the "Equipment Responsibility" that is filtered for.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, if I filter "Equipement Responsibility on the the card for "Aerospace Engineer", I get 202, which is the count of the top 5 Aerospace equipment related jobs. &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;I am looking to have this filter only provide the count of what is displayed on the top 5 visual. The card should be 144.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 13:42:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-TOP-N-for-each-Legend-items-that-are-Displayed-on-Graph/m-p/2523495#M70473</guid>
      <dc:creator>cmaloyb</dc:creator>
      <dc:date>2022-05-18T13:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Count TOP N for each Legend items that are Displayed on Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-TOP-N-for-each-Legend-items-that-are-Displayed-on-Graph/m-p/2524046#M70511</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="215885" data-lia-user-login="cmaloyb" class="lia-mention lia-mention-user"&gt;cmaloyb&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure if I fully understand but you may try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Top 5 Equipment =
SUMX (
    TOPN (
        5,
        ADDCOLUMNS (
            SUMMARIZE (
                TableName,
                TableName[Equipment],
                TableName[Equipment Responsibility]
            ),
            "@Count", CALCULATE ( DISTINCTCOUNT ( TableName[Job Number] ) )
        ),
        [@Count]
    ),
    [@Count]
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 18 May 2022 17:30:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-TOP-N-for-each-Legend-items-that-are-Displayed-on-Graph/m-p/2524046#M70511</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-18T17:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Count TOP N for each Legend items that are Displayed on Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-TOP-N-for-each-Legend-items-that-are-Displayed-on-Graph/m-p/2532421#M71066</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="215885" data-lia-user-login="cmaloyb" class="lia-mention lia-mention-user"&gt;cmaloyb&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on my test, you may need to filter&amp;nbsp;TableName[Equipment Responsibility] inside the measure expression.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Top 5 Equipment - Aerospace Engineer =
SUMX (
    FILTER (
        TOPN (
            5,
            ADDCOLUMNS (
                SUMMARIZE (
                    TableName,
                    TableName[Equipment],
                    TableName[Equipment Responsibility]
                ),
                "@Count", CALCULATE ( DISTINCTCOUNT ( TableName[Job Number] ) )
            ),
            [@Count]
        ),
        [Equipment Responsibility] = "Aerospace Engineer"
    ),
    [@Count]
)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Top 5 Equipment - Electrical Engineer =
SUMX (
    FILTER (
        TOPN (
            5,
            ADDCOLUMNS (
                SUMMARIZE (
                    TableName,
                    TableName[Equipment],
                    TableName[Equipment Responsibility]
                ),
                "@Count", CALCULATE ( DISTINCTCOUNT ( TableName[Job Number] ) )
            ),
            [@Count]
        ),
        [Equipment Responsibility] = "Electrical Engineer"
    ),
    [@Count]
)
&lt;/LI-CODE&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;Best Regards,&lt;/P&gt;
&lt;P&gt;Icey&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 07:57:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-TOP-N-for-each-Legend-items-that-are-Displayed-on-Graph/m-p/2532421#M71066</guid>
      <dc:creator>Icey</dc:creator>
      <dc:date>2022-05-23T07:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Count TOP N for each Legend items that are Displayed on Graph</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-TOP-N-for-each-Legend-items-that-are-Displayed-on-Graph/m-p/2534284#M71170</link>
      <description>&lt;P&gt;Thank you. This worked. Turns out we needed to add the filter to the DAX equation.&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 19:41:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-TOP-N-for-each-Legend-items-that-are-Displayed-on-Graph/m-p/2534284#M71170</guid>
      <dc:creator>cmaloyb</dc:creator>
      <dc:date>2022-05-23T19:41:09Z</dc:date>
    </item>
  </channel>
</rss>

