<?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: TOPN sorting in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-sorting/m-p/2002340#M44453</link>
    <description>&lt;P&gt;This appears to be the explanation I was looking for.&amp;nbsp; &amp;nbsp;I feel really dumb after seeing it, I blame being tired at the end of a day and week.&amp;nbsp; Will post back in a little after I run it through the real data set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Update:&amp;nbsp; It works!&amp;nbsp; Only problem having now in the real dataset is when I try to use a measure I have built that spits out what I want the TOPN to be (instead of using an actual number) it's funky and goes from sorting the top 95 when I use 'TOPN(95' to sorting the top 25 when I use 'TOPN([measure]' (but still keeps the total at the bottom of the table as the total of TOP95, but only showing TOP25 items, lol.&amp;nbsp; Gonna do some reading and look into what is up, but I've triple checked the measure and it's spitting out a 95 everywhere else I use it.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Aug 2021 13:01:31 GMT</pubDate>
    <dc:creator>traviscole</dc:creator>
    <dc:date>2021-08-06T13:01:31Z</dc:date>
    <item>
      <title>TOPN sorting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-sorting/m-p/2000998#M44430</link>
      <description>&lt;P&gt;I am hardcore failing at making TOPN work in DAX instead of the filters on a visual.&amp;nbsp; I have tried and looked at a million different things and ways of doing it in my real data set and this dummy sample I made, and failed at every step of the way, so am giving up for now and seeing if someone can show me what the correct way to do it is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All I need is the proper DAX to make a measure that will return the TOPN for by Volume for a dummy data set like below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My latest failure is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure = TOPN(5, Volume, Volume[Volume], desc)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;And it gives me 'expression refers to multiple columns, etc.'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I've gotten this error and others one after another, and am handing it over to someone with more knowledge than me to knock it out in 5 minutes.&amp;nbsp; Thanks in advance.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 20:34:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-sorting/m-p/2000998#M44430</guid>
      <dc:creator>traviscole</dc:creator>
      <dc:date>2021-08-05T20:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: TOPN sorting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-sorting/m-p/2001020#M44431</link>
      <description>&lt;P&gt;If you check the documentation for TOPN (&lt;A href="https://docs.microsoft.com/en-us/dax/topn-function-dax" target="_blank"&gt;here&lt;/A&gt; and/or &lt;A href="https://dax.guide/topn/" target="_self"&gt;here&lt;/A&gt;), you may notice that it returns a&amp;nbsp;&lt;EM&gt;table&lt;/EM&gt;&amp;nbsp;as its output, not a single value. A measure can only return a single value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The easiest approach is usually to use the Top N filtering option in the filter pane.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See here too: &lt;A href="https://community.powerbi.com/t5/Desktop/TopN/m-p/131646" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/TopN/m-p/131646&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 21:09:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-sorting/m-p/2001020#M44431</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2021-08-05T21:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: TOPN sorting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-sorting/m-p/2002255#M44452</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;EM&gt;Volume total : = &lt;/EM&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;SUM(Volume[Volume])&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;EM&gt;Top five volume measure : = &lt;/EM&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;CALCULATE (&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;[Volume total :],&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;KEEPFILTERS ( TOPN ( 5, ALL ( Items ), [Volume total :], DESC ) )&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://www.dropbox.com/s/udtscyw03kn0f9q/traviscole.pbix?dl=0" target="_self"&gt;Link to the sample pbix file&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 06 Aug 2021 10:55:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-sorting/m-p/2002255#M44452</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2021-08-06T10:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: TOPN sorting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-sorting/m-p/2002340#M44453</link>
      <description>&lt;P&gt;This appears to be the explanation I was looking for.&amp;nbsp; &amp;nbsp;I feel really dumb after seeing it, I blame being tired at the end of a day and week.&amp;nbsp; Will post back in a little after I run it through the real data set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Update:&amp;nbsp; It works!&amp;nbsp; Only problem having now in the real dataset is when I try to use a measure I have built that spits out what I want the TOPN to be (instead of using an actual number) it's funky and goes from sorting the top 95 when I use 'TOPN(95' to sorting the top 25 when I use 'TOPN([measure]' (but still keeps the total at the bottom of the table as the total of TOP95, but only showing TOP25 items, lol.&amp;nbsp; Gonna do some reading and look into what is up, but I've triple checked the measure and it's spitting out a 95 everywhere else I use it.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 13:01:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-sorting/m-p/2002340#M44453</guid>
      <dc:creator>traviscole</dc:creator>
      <dc:date>2021-08-06T13:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: TOPN sorting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-sorting/m-p/2002678#M44471</link>
      <description>&lt;P&gt;Yeah, that's the easy way for us people in the office to do it.&amp;nbsp; The goal is to make it go automatically by another measure that I have built to spit out a number for what I want the TOPN to be so on the user side they don't have to do anything and break the report or do god knows what.&amp;nbsp; I wish in that TOPN i nthe filter pane I could just drag in the measure instead of having to manually input the number, but it is what it is.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 15:11:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-sorting/m-p/2002678#M44471</guid>
      <dc:creator>traviscole</dc:creator>
      <dc:date>2021-08-06T15:11:43Z</dc:date>
    </item>
  </channel>
</rss>

