<?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 Dynamic Order For TopN Function in DAX in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Dynamic-Order-For-TopN-Function-in-DAX/m-p/1195366#M3262</link>
    <description>&lt;P&gt;I am new to DAX and probably making a noob mistake. I want to change my TopN order to asc or desc order based on whether the selected measure is summing to positive or negative. But so far, I have not been successful with the below code. I am not sure why the DAX is not accepting OrderTopN variable in order definition. I have been able to solve it the long way but I wanted to know why the below code ain't working?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR OrderTOPN =IF([ADPR.EM]&amp;gt;=0,1,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TopN.ADPR =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;[ADPR.EM],&lt;BR /&gt;TOPN (&lt;BR /&gt;'mn-value'[n-value Value],&lt;BR /&gt;ALL ( 'mprofile'[Org_Name] ),&lt;BR /&gt;[ADPR.EM],OrderTOPN&lt;BR /&gt;),&lt;BR /&gt;VALUES ( 'mprofile'[Org_Name] )&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RETURN TopN.ADPR&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jul 2020 14:40:55 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-07-01T14:40:55Z</dc:date>
    <item>
      <title>Dynamic Order For TopN Function in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Dynamic-Order-For-TopN-Function-in-DAX/m-p/1195366#M3262</link>
      <description>&lt;P&gt;I am new to DAX and probably making a noob mistake. I want to change my TopN order to asc or desc order based on whether the selected measure is summing to positive or negative. But so far, I have not been successful with the below code. I am not sure why the DAX is not accepting OrderTopN variable in order definition. I have been able to solve it the long way but I wanted to know why the below code ain't working?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR OrderTOPN =IF([ADPR.EM]&amp;gt;=0,1,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TopN.ADPR =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;[ADPR.EM],&lt;BR /&gt;TOPN (&lt;BR /&gt;'mn-value'[n-value Value],&lt;BR /&gt;ALL ( 'mprofile'[Org_Name] ),&lt;BR /&gt;[ADPR.EM],OrderTOPN&lt;BR /&gt;),&lt;BR /&gt;VALUES ( 'mprofile'[Org_Name] )&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RETURN TopN.ADPR&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 14:40:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Dynamic-Order-For-TopN-Function-in-DAX/m-p/1195366#M3262</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-01T14:40:55Z</dc:date>
    </item>
  </channel>
</rss>

