<?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: Count number of orders that exist in projects that contains at least 20 orders in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-orders-that-exist-in-projects-that-contains-at/m-p/2874522#M92866</link>
    <description>&lt;P&gt;You could get the average number of orders with&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Avg orders &amp;gt; 20 =
AVERAGEX (
    FILTER ( VALUES ( 'Project'[Project number] ), [count order id] &amp;gt; 20 ),
    [count order id]
)
&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 31 Oct 2022 11:37:39 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2022-10-31T11:37:39Z</dc:date>
    <item>
      <title>Count number of orders that exist in projects that contains at least 20 orders</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-orders-that-exist-in-projects-that-contains-at/m-p/2874469#M92862</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been trying to solve this issue for some hours but I'm getting nowhere.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, I have two tables, one for ORDER and one for PROJECT. I'm trying to count how many orders on average there are per project. However, I need to filter out projects where the orders are less than 20.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I've created a measure that only calculates the count of projects where the orders are more than 20:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;count project id filter = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;COUNT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;PROJECT&lt;/SPAN&gt;&lt;SPAN&gt;[PROJECT NUMBER]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;PROJECT&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'ORDER'&lt;/SPAN&gt;&lt;SPAN&gt;[count order id]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt; 20&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The measure count order id is just a DISTINCTCOUNT on order id, nothing else.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I can't seem to create the measure that counts number of orders that exist WITHIN those projects. I feel like the logic is quite circular because I'm trying to filter a table based on conditons on itself. This is what I've tried, but I'm guessing I'm using the wrong logic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;count order id filter = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;COUNT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'ORDER'&lt;/SPAN&gt;&lt;SPAN&gt;[ORDER_ID]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'ORDER'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;ORDER'&lt;/SPAN&gt;&lt;SPAN&gt;[count order id]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt; 20&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This obviously does not work as it does not have any condition on the PROJECTS. I also tried using some AND operator, but I can't figure out where and how to place the condition to only include projects where order count is &amp;gt; 20.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Does anyone have any ideas? I'm guessing I could use a totally different logic here, but I'm not super experienced in DAX.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 10:58:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-orders-that-exist-in-projects-that-contains-at/m-p/2874469#M92862</guid>
      <dc:creator>MrMano</dc:creator>
      <dc:date>2022-10-31T10:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of orders that exist in projects that contains at least 20 orders</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-orders-that-exist-in-projects-that-contains-at/m-p/2874522#M92866</link>
      <description>&lt;P&gt;You could get the average number of orders with&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Avg orders &amp;gt; 20 =
AVERAGEX (
    FILTER ( VALUES ( 'Project'[Project number] ), [count order id] &amp;gt; 20 ),
    [count order id]
)
&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 31 Oct 2022 11:37:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-orders-that-exist-in-projects-that-contains-at/m-p/2874522#M92866</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-10-31T11:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of orders that exist in projects that contains at least 20 orders</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-orders-that-exist-in-projects-that-contains-at/m-p/2874555#M92868</link>
      <description>&lt;P&gt;Thank you! It worked perfectly.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 12:11:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-orders-that-exist-in-projects-that-contains-at/m-p/2874555#M92868</guid>
      <dc:creator>MrMano</dc:creator>
      <dc:date>2022-10-31T12:11:50Z</dc:date>
    </item>
  </channel>
</rss>

