<?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 PBIRS Jan2023 : TopN throwing error in Directquery report in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/PBIRS-Jan2023-TopN-throwing-error-in-Directquery-report/m-p/3195744#M29552</link>
    <description>&lt;P&gt;We have a Direct Query Report running on &lt;STRONG&gt;PBIRS Jan2023&lt;/STRONG&gt;. On the report we have a visual that displays top 20 values by a category. The Top 20 is set in the Filter Pane for the visual. Earlier to Jan2023, this was working fine. But after Jan2023 upgrade , the visual throws error "TopN with Ties clause is not allowed without a corresponding Orderby clause."&amp;nbsp;&lt;/P&gt;&lt;P&gt;We did refer to the Feature summary &lt;A href="https://powerbi.microsoft.com/en-sg/blog/power-bi-report-server-january-2023-feature-summary/#post-21998-_Toc121395757" target="_blank" rel="noopener"&gt;Power BI Report Server January 2023 Feature Summary | Microsoft Power BI Blog | Microsoft Power BI&lt;/A&gt;. The measure is already set to DistinctCount.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The report has 3 datasets RV , AL and PS, The relationship is set as&amp;nbsp; RV (1:M) AL ( direction both) ,&amp;nbsp; RV (1:M) PS (direction both).&lt;/P&gt;&lt;P&gt;The visual has category and value from the AL dataset.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The visual does not throw any error until we add a report level filter (filter on all pages) from the PS dataset.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I captuared the query that was generated using SQLProfiler.&amp;nbsp; Below is the easy to understand version of that query. As you see there are two WithTies and the inner one is missing the orderby clause.&lt;/P&gt;&lt;P&gt;SELECT TOP (20)&amp;nbsp;WITH TIES *&lt;BR /&gt;FROM (&lt;BR /&gt;SELECT TOP (20) WITH TIES [basetable0].[c12] ,COUNT_BIG(DISTINCT [a0]) AS [a0]&lt;BR /&gt;FROM (&lt;BR /&gt;SELECT v.VID [c2], CDSID [a0],AckBy [c12] FROM AL a&lt;BR /&gt;INNER JOIN RV v ON v.[VID] = a.[VID]&lt;BR /&gt;INNER JOIN PS p ON v.[VID] = p.[VID]&lt;BR /&gt;WHERE p.[PSID] = 1323&lt;BR /&gt;) [basetable0]&lt;BR /&gt;GROUP BY [basetable0].[c12]&lt;BR /&gt;) AS [MainTable]&lt;BR /&gt;ORDER BY [a0] DESC&lt;/P&gt;</description>
    <pubDate>Wed, 19 Apr 2023 12:18:34 GMT</pubDate>
    <dc:creator>parag_lokare</dc:creator>
    <dc:date>2023-04-19T12:18:34Z</dc:date>
    <item>
      <title>PBIRS Jan2023 : TopN throwing error in Directquery report</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/PBIRS-Jan2023-TopN-throwing-error-in-Directquery-report/m-p/3195744#M29552</link>
      <description>&lt;P&gt;We have a Direct Query Report running on &lt;STRONG&gt;PBIRS Jan2023&lt;/STRONG&gt;. On the report we have a visual that displays top 20 values by a category. The Top 20 is set in the Filter Pane for the visual. Earlier to Jan2023, this was working fine. But after Jan2023 upgrade , the visual throws error "TopN with Ties clause is not allowed without a corresponding Orderby clause."&amp;nbsp;&lt;/P&gt;&lt;P&gt;We did refer to the Feature summary &lt;A href="https://powerbi.microsoft.com/en-sg/blog/power-bi-report-server-january-2023-feature-summary/#post-21998-_Toc121395757" target="_blank" rel="noopener"&gt;Power BI Report Server January 2023 Feature Summary | Microsoft Power BI Blog | Microsoft Power BI&lt;/A&gt;. The measure is already set to DistinctCount.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The report has 3 datasets RV , AL and PS, The relationship is set as&amp;nbsp; RV (1:M) AL ( direction both) ,&amp;nbsp; RV (1:M) PS (direction both).&lt;/P&gt;&lt;P&gt;The visual has category and value from the AL dataset.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The visual does not throw any error until we add a report level filter (filter on all pages) from the PS dataset.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I captuared the query that was generated using SQLProfiler.&amp;nbsp; Below is the easy to understand version of that query. As you see there are two WithTies and the inner one is missing the orderby clause.&lt;/P&gt;&lt;P&gt;SELECT TOP (20)&amp;nbsp;WITH TIES *&lt;BR /&gt;FROM (&lt;BR /&gt;SELECT TOP (20) WITH TIES [basetable0].[c12] ,COUNT_BIG(DISTINCT [a0]) AS [a0]&lt;BR /&gt;FROM (&lt;BR /&gt;SELECT v.VID [c2], CDSID [a0],AckBy [c12] FROM AL a&lt;BR /&gt;INNER JOIN RV v ON v.[VID] = a.[VID]&lt;BR /&gt;INNER JOIN PS p ON v.[VID] = p.[VID]&lt;BR /&gt;WHERE p.[PSID] = 1323&lt;BR /&gt;) [basetable0]&lt;BR /&gt;GROUP BY [basetable0].[c12]&lt;BR /&gt;) AS [MainTable]&lt;BR /&gt;ORDER BY [a0] DESC&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 12:18:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/PBIRS-Jan2023-TopN-throwing-error-in-Directquery-report/m-p/3195744#M29552</guid>
      <dc:creator>parag_lokare</dc:creator>
      <dc:date>2023-04-19T12:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: PBIRS Jan2023 : TopN throwing error in Directquery report</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/PBIRS-Jan2023-TopN-throwing-error-in-Directquery-report/m-p/3196774#M29561</link>
      <description>&lt;P&gt;If this stopped working after the upgrade it sounds like it might be a bug and you should raise a support ticked with Microsoft to get this investigated.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 00:01:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/PBIRS-Jan2023-TopN-throwing-error-in-Directquery-report/m-p/3196774#M29561</guid>
      <dc:creator>d_gosbell</dc:creator>
      <dc:date>2023-04-20T00:01:20Z</dc:date>
    </item>
  </channel>
</rss>

