<?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 with variable for N_Value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-with-variable-for-N-Value/m-p/4098294#M162625</link>
    <description>&lt;P&gt;I just don't get any results... version 2 uses the function, version 1 is hard coded&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Aug 2024 17:28:44 GMT</pubDate>
    <dc:creator>NW953</dc:creator>
    <dc:date>2024-08-13T17:28:44Z</dc:date>
    <item>
      <title>TOPN with variable for N_Value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-with-variable-for-N-Value/m-p/4098210#M162617</link>
      <description>&lt;P&gt;I have software usage data and depending of the software type we want to assign the TOPN users to discounted seats.... The number of discounted seats we have varies by software type... At the end I have a table that shows all of the pricing options and we want to select the cheapest route per user and come up with a total budget...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently using TOPN to create a top number of users in software reports and the function works well if I enter a stactic value for the N_value, however if I try to use a function in the place the measure does not work even htough I have confirmed the right number is getting passed with the function... Is this a bug/ limitation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if I replace the number 69 below with any other method of getting that number the measure stops working... I need N_value to be dynamic... what am I doing wrong here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example I want to replace 69 here with min(discounted seats)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&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gt;min&lt;/SPAN&gt;&lt;SPAN&gt;(Usage[PDM Discount Seat Cost])),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;filter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(Usage[email]), Usage[email] &lt;/SPAN&gt;&lt;SPAN&gt;IN&lt;/SPAN&gt;&lt;SPAN&gt; PDM_Disc_Users)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Aug 2024 16:49:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-with-variable-for-N-Value/m-p/4098210#M162617</guid>
      <dc:creator>NW953</dc:creator>
      <dc:date>2024-08-13T16:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: TOPN with variable for N_Value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-with-variable-for-N-Value/m-p/4098260#M162621</link>
      <description>&lt;P&gt;Try setting&amp;nbsp;&lt;SPAN&gt;min(discounted seats) to a variable and then use it instead of 69.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2024 17:11:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-with-variable-for-N-Value/m-p/4098260#M162621</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2024-08-13T17:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: TOPN with variable for N_Value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-with-variable-for-N-Value/m-p/4098267#M162622</link>
      <description>&lt;P&gt;I have tried that as well, no luck&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2024 17:17:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-with-variable-for-N-Value/m-p/4098267#M162622</guid>
      <dc:creator>NW953</dc:creator>
      <dc:date>2024-08-13T17:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: TOPN with variable for N_Value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-with-variable-for-N-Value/m-p/4098270#M162623</link>
      <description>&lt;P&gt;What error do you get ?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2024 17:19:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-with-variable-for-N-Value/m-p/4098270#M162623</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2024-08-13T17:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: TOPN with variable for N_Value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-with-variable-for-N-Value/m-p/4098294#M162625</link>
      <description>&lt;P&gt;I just don't get any results... version 2 uses the function, version 1 is hard coded&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2024 17:28:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-with-variable-for-N-Value/m-p/4098294#M162625</guid>
      <dc:creator>NW953</dc:creator>
      <dc:date>2024-08-13T17:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: TOPN with variable for N_Value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-with-variable-for-N-Value/m-p/4098447#M162628</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="769630" data-lia-user-login="NW953" class="lia-mention lia-mention-user"&gt;NW953&lt;/a&gt;, try this one and let me know if there is any problem.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Forecast PDM Discount Seat Cost =
var N_Value = MIN(Usage[Discounted Seats])
var PDM_Disc_Users =
TOPN(N_Value,ALLSELECTED(Usage[email]),
[PDM Usage],DESC)
RETURN
CALCULATE(sumx(
values(Usage[email]),
min(Usage[PDM Discount Seat Cost])),
filter(VALUES(Usage[email]),Usage[email] IN PDM_Disc_Users))&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 13 Aug 2024 19:16:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TOPN-with-variable-for-N-Value/m-p/4098447#M162628</guid>
      <dc:creator>ahadkarimi</dc:creator>
      <dc:date>2024-08-13T19:16:35Z</dc:date>
    </item>
  </channel>
</rss>

