<?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 Correcting the blank value returned in TOPN for negative numbers in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correcting-the-blank-value-returned-in-TOPN-for-negative-numbers/m-p/2502095#M69189</link>
    <description>&lt;P&gt;Hi, everyone. I'm trying to create a card which shows the name of the manager whose store ranked with most financial losses per month. I've implemented this with a data slicer and a map. The data slicer is segmented by State and Store Name and I wanna see the name of the manager of each store if it is selected in the data slicer too. However, there's a limitation in the Dax Formula I'm using it. That's because the value of financial losses can be negative or positive and whenever I select a store with negative value on the data slicer, my card returns blank value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the following measure to show the Top1 manager of the month:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;Coordenador = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FIRSTNONBLANK&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'ABRIL 22'[COOR ATU]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;TOPN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'ABRIL 22'[COOR ATU]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;[Perda Total]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;DESC&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Could somebody give me a hint?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 09 May 2022 13:02:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-05-09T13:02:37Z</dc:date>
    <item>
      <title>Correcting the blank value returned in TOPN for negative numbers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correcting-the-blank-value-returned-in-TOPN-for-negative-numbers/m-p/2502095#M69189</link>
      <description>&lt;P&gt;Hi, everyone. I'm trying to create a card which shows the name of the manager whose store ranked with most financial losses per month. I've implemented this with a data slicer and a map. The data slicer is segmented by State and Store Name and I wanna see the name of the manager of each store if it is selected in the data slicer too. However, there's a limitation in the Dax Formula I'm using it. That's because the value of financial losses can be negative or positive and whenever I select a store with negative value on the data slicer, my card returns blank value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the following measure to show the Top1 manager of the month:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;Coordenador = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FIRSTNONBLANK&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'ABRIL 22'[COOR ATU]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;TOPN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'ABRIL 22'[COOR ATU]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;[Perda Total]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;DESC&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Could somebody give me a hint?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 09 May 2022 13:02:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correcting-the-blank-value-returned-in-TOPN-for-negative-numbers/m-p/2502095#M69189</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-09T13:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting the blank value returned in TOPN for negative numbers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correcting-the-blank-value-returned-in-TOPN-for-negative-numbers/m-p/2502191#M69193</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;Do you have a small example file to help understand?&amp;nbsp; &amp;nbsp;You can use ABS[Measure Name]) to give absolute values so it won't matter if positive or negative(if that's what you want).&lt;/P&gt;&lt;P&gt;Generally, this measure should help get top 1 no matter the tme frame you slice on:&lt;/P&gt;&lt;P&gt;If&amp;nbsp;&lt;SPAN&gt;[Perda Total] = the financial loses and you have a separate dim&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;table for all of your unique financial managers names, e.g. Manager[Mgr Name] as one column in this table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Top1 mgr = CALCULATE([Perda Total],&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TOPN(1, Managers[Mgr Name], DESC)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You should also have a separate Date Table where you can slice on month, year ,etc and the Top1 will show up based on your slections.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I hope this helps!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;P.S. An example model is placed below so you can see the relationships which brings all the nalytical power.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 13:29:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correcting-the-blank-value-returned-in-TOPN-for-negative-numbers/m-p/2502191#M69193</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-05-09T13:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting the blank value returned in TOPN for negative numbers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correcting-the-blank-value-returned-in-TOPN-for-negative-numbers/m-p/2502233#M69195</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Currently, the dashboard is like this. In fact, there are 3 types of job titles related for each store. All three are blank whenever I select a Store with negative value for Total Loss. I don't think ABS() function would solve my problem because a negative value could rank higher than a positive value using this function. I just would like a way to use TOPN or another function considering negative and positive numbers on the ranking.&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 13:52:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correcting-the-blank-value-returned-in-TOPN-for-negative-numbers/m-p/2502233#M69195</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-09T13:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting the blank value returned in TOPN for negative numbers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correcting-the-blank-value-returned-in-TOPN-for-negative-numbers/m-p/2509201#M69559</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Top N does not work with negative numbers.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try to replace with function &lt;A href="https://docs.microsoft.com/en-us/dax/sample-function-dax" target="_blank" rel="noopener"&gt;'SAMPLE'&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Coordenador2 = CALCULATE(FIRSTNONBLANK('ABRIL 22'[COOR ATU],1),SAMPLE(1,'ABRIL 22',[Perda Total],DESC))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;You can also create a sort column 'Rank' using&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/dax/rankx-function-dax" target="_blank" rel="noopener"&gt;‘RANKX’&lt;/A&gt;, then filter data with ‘Rank’=1.&lt;/P&gt;
&lt;P&gt;Please refer this related tread.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/topn-dax-for-negative-values/td-p/1034645" target="_blank" rel="noopener"&gt;topn-dax-for-negative-values&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Eason&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 03:14:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correcting-the-blank-value-returned-in-TOPN-for-negative-numbers/m-p/2509201#M69559</guid>
      <dc:creator>v-easonf-msft</dc:creator>
      <dc:date>2022-05-12T03:14:27Z</dc:date>
    </item>
  </channel>
</rss>

