<?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: &amp;quot;The TOPNSKIP function incompatible with DirectQuery&amp;quot;, but my entire model is Import only? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-The-TOPNSKIP-function-incompatible-with-DirectQuery-quot/m-p/4125434#M163820</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="755400" data-lia-user-login="Brightsider" class="lia-mention lia-mention-user"&gt;Brightsider&lt;/a&gt;, give this a try, and if you encounter any issues, let me know.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EVALUATE
VAR _measureresultstable = 
FILTER(
    ADDCOLUMNS(
        ALLSELECTED('System Users'),
        "MeasureResults", SELECTEDMEASURE()
    ),
    NOT(ISBLANK([MeasureResults]))
)

VAR _RankedTable =
ADDCOLUMNS(
    _measureresultstable,
    "Rank", RANKX(_measureresultstable, [MeasureResults], , DESC)
)

VAR _OurNumberTwo = 
TOPN(
    1,
    FILTER(_RankedTable, [Rank] = 2),  -- Change 2 to 3 for 3rd highest
    [MeasureResults], DESC
)

RETURN
    _OurNumberTwo&lt;/LI-CODE&gt;&lt;P align="center"&gt;&lt;FONT face="verdana,geneva"&gt;&lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;Did I answer your question?&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;If so, please mark my post as the solution! &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="verdana,geneva"&gt;&lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;Your Kudos are much appreciated!&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;Proud to be a Solution Supplier!&lt;/STRONG&gt;&lt;/FONT&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2024 17:18:24 GMT</pubDate>
    <dc:creator>ahadkarimi</dc:creator>
    <dc:date>2024-08-29T17:18:24Z</dc:date>
    <item>
      <title>"The TOPNSKIP function incompatible with DirectQuery", but my entire model is Import only?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-The-TOPNSKIP-function-incompatible-with-DirectQuery-quot/m-p/4125416#M163819</link>
      <description>&lt;P&gt;So, I'm trying to implement some calculation items as reporting controls to allow me to only show results for the 2nd Highest or 3rd Highest user according the the result of some measure. The TOPNSKIP function seemed like the perfect thing to make this happen:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EVALUATE
VAR _measureresultstable = 
FILTER(
	ADDCOLUMNS(
		ALLSELECTED('System Users'),
		"MeasureResults",
		SELECTEDMEASURE()
	),
	NOT(ISBLANK([MeasureResults]))
)

VAR _OurNumberTwo = 
TOPNSKIP(
    2,
    1,
    _measureresultstable,
    [MeasureResults], DESC
)
RETURN
	_OurNumberTwo&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I run the function in the DAX Query view, or when I try to create it as a measure, I get the following error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;The TOPNSKIP function is incompatible with the DirectQuery data source, as it does not support skipping rows before returning the result rows.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, the entirety of my data model, including the tables I am using in the calculation item, are all set to Import mode. I don't have a single DirectQuery data source in my entire model. What explains why TOPNSKIP would not function?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 17:05:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-The-TOPNSKIP-function-incompatible-with-DirectQuery-quot/m-p/4125416#M163819</guid>
      <dc:creator>Brightsider</dc:creator>
      <dc:date>2024-08-29T17:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: "The TOPNSKIP function incompatible with DirectQuery", but my entire model is Import only?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-The-TOPNSKIP-function-incompatible-with-DirectQuery-quot/m-p/4125434#M163820</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="755400" data-lia-user-login="Brightsider" class="lia-mention lia-mention-user"&gt;Brightsider&lt;/a&gt;, give this a try, and if you encounter any issues, let me know.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EVALUATE
VAR _measureresultstable = 
FILTER(
    ADDCOLUMNS(
        ALLSELECTED('System Users'),
        "MeasureResults", SELECTEDMEASURE()
    ),
    NOT(ISBLANK([MeasureResults]))
)

VAR _RankedTable =
ADDCOLUMNS(
    _measureresultstable,
    "Rank", RANKX(_measureresultstable, [MeasureResults], , DESC)
)

VAR _OurNumberTwo = 
TOPN(
    1,
    FILTER(_RankedTable, [Rank] = 2),  -- Change 2 to 3 for 3rd highest
    [MeasureResults], DESC
)

RETURN
    _OurNumberTwo&lt;/LI-CODE&gt;&lt;P align="center"&gt;&lt;FONT face="verdana,geneva"&gt;&lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;Did I answer your question?&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;If so, please mark my post as the solution! &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="verdana,geneva"&gt;&lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;Your Kudos are much appreciated!&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;Proud to be a Solution Supplier!&lt;/STRONG&gt;&lt;/FONT&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 17:18:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-The-TOPNSKIP-function-incompatible-with-DirectQuery-quot/m-p/4125434#M163820</guid>
      <dc:creator>ahadkarimi</dc:creator>
      <dc:date>2024-08-29T17:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: "The TOPNSKIP function incompatible with DirectQuery", but my entire model is Import only?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-The-TOPNSKIP-function-incompatible-with-DirectQuery-quot/m-p/4125438#M163821</link>
      <description>&lt;P&gt;Thank you again for the prompt reply,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="785426" data-lia-user-login="ahadkarimi" class="lia-mention lia-mention-user"&gt;ahadkarimi&lt;/a&gt;! One thing I did want to know is: why does the RANK/RANKX approach work fine, but TOPNSKIP can't deliver the goods?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 17:21:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-The-TOPNSKIP-function-incompatible-with-DirectQuery-quot/m-p/4125438#M163821</guid>
      <dc:creator>Brightsider</dc:creator>
      <dc:date>2024-08-29T17:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: "The TOPNSKIP function incompatible with DirectQuery", but my entire model is Import only?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-The-TOPNSKIP-function-incompatible-with-DirectQuery-quot/m-p/4125442#M163824</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="755400" data-lia-user-login="Brightsider" class="lia-mention lia-mention-user"&gt;Brightsider&lt;/a&gt;,&lt;BR /&gt;&lt;STRONG&gt;RANKX&lt;/STRONG&gt;&amp;nbsp;works well because it ranks rows without skipping any, making it fully compatible with Import mode. On the other hand, &lt;STRONG&gt;TOPNSKIP&lt;/STRONG&gt; involves skipping rows, which the DAX engine restricts due to its usual incompatibility with DirectQuery scenarios, even if your model is in Import mode.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 17:30:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-The-TOPNSKIP-function-incompatible-with-DirectQuery-quot/m-p/4125442#M163824</guid>
      <dc:creator>ahadkarimi</dc:creator>
      <dc:date>2024-08-29T17:30:53Z</dc:date>
    </item>
  </channel>
</rss>

