<?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 Top N with DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Top-N-with-DAX/m-p/3347030#M125672</link>
    <description>&lt;P&gt;Hello Dear Community,&lt;/P&gt;&lt;P&gt;I've got a dataset with only one table:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Here's a few row's example:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Every song has a genre and a popularity. I just want to create a visual showing the top 5 genres based on their average popularity.&lt;/P&gt;&lt;P&gt;It shouldn't be too hard to do, but I can't make it &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I can make it adding filters in a bar chart, but I'd like to know how to do it with DAX:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Could you please give me a hand?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jul 2023 16:52:00 GMT</pubDate>
    <dc:creator>LuisNC</dc:creator>
    <dc:date>2023-07-24T16:52:00Z</dc:date>
    <item>
      <title>Top N with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Top-N-with-DAX/m-p/3347030#M125672</link>
      <description>&lt;P&gt;Hello Dear Community,&lt;/P&gt;&lt;P&gt;I've got a dataset with only one table:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Here's a few row's example:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Every song has a genre and a popularity. I just want to create a visual showing the top 5 genres based on their average popularity.&lt;/P&gt;&lt;P&gt;It shouldn't be too hard to do, but I can't make it &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I can make it adding filters in a bar chart, but I'd like to know how to do it with DAX:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Could you please give me a hand?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 16:52:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Top-N-with-DAX/m-p/3347030#M125672</guid>
      <dc:creator>LuisNC</dc:creator>
      <dc:date>2023-07-24T16:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Top N with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Top-N-with-DAX/m-p/3347889#M125712</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="530298" data-lia-user-login="LuisNC" class="lia-mention lia-mention-user"&gt;LuisNC&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use a pattern like this:&lt;/P&gt;
&lt;P&gt;1. First create an &lt;STRONG&gt;Average Popularity&lt;/STRONG&gt; measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Average Popularity = 
AVERAGE ( spotify_tracks[popularity] )&lt;/LI-CODE&gt;
&lt;P&gt;2. Next create the measure&amp;nbsp;&lt;STRONG&gt;Average Popularity for Top 5 Genres&lt;/STRONG&gt;:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Average Popularity for Top 5 Genres =
VAR N = 5
VAR TopGenres =
    CALCULATETABLE (
        TOPN (
            N,
            VALUES ( spotify_tracks[genre] ),
            [Average Popularity]
        ),
        ALLSELECTED ()
    )
RETURN
    CALCULATE (
        [Average Popularity],
        KEEPFILTERS ( TopGenres )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;3. Place the measure &lt;STRONG&gt;Average Popularity for Top 5 Genres&amp;nbsp;&lt;/STRONG&gt;in the visual with genre on the axis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this work for you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 05:19:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Top-N-with-DAX/m-p/3347889#M125712</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2023-07-25T05:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Top N with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Top-N-with-DAX/m-p/3353030#M125926</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="6799" data-lia-user-login="OwenAuger" class="lia-mention lia-mention-user"&gt;OwenAuger&lt;/a&gt;&amp;nbsp;, It's correct !!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 10:48:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Top-N-with-DAX/m-p/3353030#M125926</guid>
      <dc:creator>LuisNC</dc:creator>
      <dc:date>2023-07-27T10:48:49Z</dc:date>
    </item>
  </channel>
</rss>

