<?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 ranking working in Dax Query view but not in Visual in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TopN-ranking-working-in-Dax-Query-view-but-not-in-Visual/m-p/4737281#M181447</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="904088" data-lia-user-login="anwarbham" class="lia-mention lia-mention-user"&gt;anwarbham&lt;/a&gt;&amp;nbsp;- You are returning a table in TOPN and that cannot be produced as the output of a measure in a visual.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will be able to use this DAX to create a Calculated table. Or you could use the TOPN as a Variable (VAR) and then you can RETURN a calculation that aggregates or selects something from this table stored in the variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="padding: 1em; border: 3px solid #287EC7;"&gt;If I answered your question &lt;STRONG&gt; please mark my post as the solution&lt;/STRONG&gt;, it helps others with the same challenge find the answer!&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jun 2025 09:39:43 GMT</pubDate>
    <dc:creator>mark_endicott</dc:creator>
    <dc:date>2025-06-19T09:39:43Z</dc:date>
    <item>
      <title>TopN ranking working in Dax Query view but not in Visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TopN-ranking-working-in-Dax-Query-view-but-not-in-Visual/m-p/4737104#M181438</link>
      <description>&lt;P&gt;Hi i am seeing some strange issue with the TopN function in power Bi&lt;/P&gt;&lt;P&gt;i have a dax formula&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    TOPN(
        10, // &amp;lt;-- This is N. Change to 5 for Top 5, 20 for Top 20, etc.
        VALUES(Fact_Table[EndDate_Time_Value]), -- &amp;lt;-- IMPORTANT: CHANGE THIS to the column you want to rank (e.g., VALUES('Product'[Product Name]))
          CALCULATE(
        SUM(Fact_Table[EndDate_Time_Value]),
        Fact_Table[stage] = "4B",
        Fact_Table[Produktion] = "OFF",
        Fact_Table[_Flag.1] = 1
    )
    )&lt;/LI-CODE&gt;&lt;P&gt;this works in the Dax Query studio&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;but in the visual i get this message&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;my table is below&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;is this a bug ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 08:00:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TopN-ranking-working-in-Dax-Query-view-but-not-in-Visual/m-p/4737104#M181438</guid>
      <dc:creator>anwarbham</dc:creator>
      <dc:date>2025-06-19T08:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: TopN ranking working in Dax Query view but not in Visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TopN-ranking-working-in-Dax-Query-view-but-not-in-Visual/m-p/4737146#M181442</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;TOPN returns a table.&lt;BR /&gt;A measure cannot be a table of values but a single value. It works in query view as a DAX query returns a table. If you want to have it working in the DAX formula in Power BI you need to create a calculated table and not a measure. If you need a measure then you need to aggregate the values of this table. Hope I was clear, otherwise come back to me. You cann attach the pbix and I shall help but I need to know what you are trying to calculate.&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;FB&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 08:16:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TopN-ranking-working-in-Dax-Query-view-but-not-in-Visual/m-p/4737146#M181442</guid>
      <dc:creator>FBergamaschi</dc:creator>
      <dc:date>2025-06-19T08:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: TopN ranking working in Dax Query view but not in Visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TopN-ranking-working-in-Dax-Query-view-but-not-in-Visual/m-p/4737233#M181446</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="904088" data-lia-user-login="anwarbham" class="lia-mention lia-mention-user"&gt;anwarbham&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This happens because TOPN returns a table&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this answers your questions, kindly accept it as solution and give kudos.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 09:18:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TopN-ranking-working-in-Dax-Query-view-but-not-in-Visual/m-p/4737233#M181446</guid>
      <dc:creator>mdaatifraza5556</dc:creator>
      <dc:date>2025-06-19T09:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: TopN ranking working in Dax Query view but not in Visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TopN-ranking-working-in-Dax-Query-view-but-not-in-Visual/m-p/4737281#M181447</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="904088" data-lia-user-login="anwarbham" class="lia-mention lia-mention-user"&gt;anwarbham&lt;/a&gt;&amp;nbsp;- You are returning a table in TOPN and that cannot be produced as the output of a measure in a visual.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will be able to use this DAX to create a Calculated table. Or you could use the TOPN as a Variable (VAR) and then you can RETURN a calculation that aggregates or selects something from this table stored in the variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="padding: 1em; border: 3px solid #287EC7;"&gt;If I answered your question &lt;STRONG&gt; please mark my post as the solution&lt;/STRONG&gt;, it helps others with the same challenge find the answer!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 09:39:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TopN-ranking-working-in-Dax-Query-view-but-not-in-Visual/m-p/4737281#M181447</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2025-06-19T09:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: TopN ranking working in Dax Query view but not in Visual</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TopN-ranking-working-in-Dax-Query-view-but-not-in-Visual/m-p/4737539#M181453</link>
      <description>&lt;P&gt;Thanks for the kudos, in case it is ok like this can you mark it as a solution? Otherwise here I am Best, FB&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 11:42:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TopN-ranking-working-in-Dax-Query-view-but-not-in-Visual/m-p/4737539#M181453</guid>
      <dc:creator>FBergamaschi</dc:creator>
      <dc:date>2025-06-19T11:42:30Z</dc:date>
    </item>
  </channel>
</rss>

