<?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: How to write DAX that uses TOPN AVERAGEX and FILTER in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-write-DAX-that-uses-TOPN-AVERAGEX-and-FILTER/m-p/2880265#M93199</link>
    <description>&lt;P&gt;I have sent a message to the person who *thinks* they solved my issue.&amp;nbsp; As you can see, they didn't entirely answer it (SELECTEDVALUE) and I did.&amp;nbsp; I was not sure about approving my own solution, but now I will.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 02 Nov 2022 13:22:44 GMT</pubDate>
    <dc:creator>AaronToth</dc:creator>
    <dc:date>2022-11-02T13:22:44Z</dc:date>
    <item>
      <title>How to write DAX that uses TOPN AVERAGEX and FILTER</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-write-DAX-that-uses-TOPN-AVERAGEX-and-FILTER/m-p/2865978#M92360</link>
      <description>&lt;P&gt;I have a DAX measure that is able to look at a table and get me the TOPN/AVERAGEX results&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TOPN_AVG:= AVERAGEX(TOPN(151, Table1, Table1[column], DESC), Table1[column])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is working fine but fails when I tried to add expression conditions or a filter to the DAX code.&amp;nbsp; If I add the condition in the expression, or a filter, I see the following error(s)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#errors&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TOPN_AVG:= AVERAGEX(TOPN(151, Table1, Table1[column], DESC), Table1.Column2 = 'RED')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TOPN_AVG:= AVERAGEX(TOPN(151, Table1, Table1[column], DESC), FILTER(Table1, Table1.Column2 = 'RED')&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;AVERAGEX cannot work with type BOOLEAN&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Multiple columns cannot be converted to a scaler&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;How do I add a two column filter/condition to this code?&amp;nbsp; I'm trying to capture the "SELECTEDVALUE" from two slicers, and have them added as filters to the code.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 20:54:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-write-DAX-that-uses-TOPN-AVERAGEX-and-FILTER/m-p/2865978#M92360</guid>
      <dc:creator>AaronToth</dc:creator>
      <dc:date>2022-10-26T20:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to write DAX that uses TOPN AVERAGEX and FILTER</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-write-DAX-that-uses-TOPN-AVERAGEX-and-FILTER/m-p/2866533#M92388</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your desired outcome looks like, but please try the below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;TOPN_AVG :=
AVERAGEX (
    TOPN ( 151, FILTER ( Table1, Table1[Column2] = 'RED' ), Table1[column], DESC ),
    Table1[column]
)
&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 27 Oct 2022 03:10:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-write-DAX-that-uses-TOPN-AVERAGEX-and-FILTER/m-p/2866533#M92388</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2022-10-27T03:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to write DAX that uses TOPN AVERAGEX and FILTER</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-write-DAX-that-uses-TOPN-AVERAGEX-and-FILTER/m-p/2867773#M92445</link>
      <description>&lt;P&gt;Thanks for your answer, but I was looking for something like this -&amp;gt;&lt;BR /&gt;In your example, you omitted the "SELECTEDVALUE" part.&amp;nbsp; I have added that below.&amp;nbsp; Together, we have solved this.&lt;BR /&gt;&lt;BR /&gt;TOPN_AVG :=&lt;BR /&gt;AVERAGEX (&lt;BR /&gt;TOPN ( 151, FILTER ( Table1, Table1[Column2] = FILTER(Table1, Table1[column2] = SELECTEDVALUE[column2])), Table1[column], DESC ),&lt;BR /&gt;Table1[column]&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 11:00:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-write-DAX-that-uses-TOPN-AVERAGEX-and-FILTER/m-p/2867773#M92445</guid>
      <dc:creator>AaronToth</dc:creator>
      <dc:date>2022-10-27T11:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to write DAX that uses TOPN AVERAGEX and FILTER</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-write-DAX-that-uses-TOPN-AVERAGEX-and-FILTER/m-p/2878966#M93111</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="256185" data-lia-user-login="AaronToth" class="lia-mention lia-mention-user"&gt;AaronToth&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your problem has been solved, please accept your reply as solution to close this thread.&lt;/P&gt;
&lt;P&gt;So that other community members will easily find the solution when they get the same issue.&lt;/P&gt;
&lt;P&gt;If you stiil need help, please share more details.&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>Wed, 02 Nov 2022 05:50:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-write-DAX-that-uses-TOPN-AVERAGEX-and-FILTER/m-p/2878966#M93111</guid>
      <dc:creator>v-easonf-msft</dc:creator>
      <dc:date>2022-11-02T05:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to write DAX that uses TOPN AVERAGEX and FILTER</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-write-DAX-that-uses-TOPN-AVERAGEX-and-FILTER/m-p/2880265#M93199</link>
      <description>&lt;P&gt;I have sent a message to the person who *thinks* they solved my issue.&amp;nbsp; As you can see, they didn't entirely answer it (SELECTEDVALUE) and I did.&amp;nbsp; I was not sure about approving my own solution, but now I will.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 13:22:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-write-DAX-that-uses-TOPN-AVERAGEX-and-FILTER/m-p/2880265#M93199</guid>
      <dc:creator>AaronToth</dc:creator>
      <dc:date>2022-11-02T13:22:44Z</dc:date>
    </item>
  </channel>
</rss>

