<?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: Amount of open orders on each day in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-open-orders-on-each-day/m-p/4357607#M172992</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="910491" data-lia-user-login="dicere" class="lia-mention lia-mention-user"&gt;dicere&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please try this approach:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Open Orders = 
VAR CurrentDate = SELECTEDVALUE('Calendar'[Date])
RETURN
    COUNTROWS(
        FILTER(
            'Orders',
            'Orders'[start_date] &amp;lt;= CurrentDate &amp;amp;&amp;amp;
            'Orders'[final_date] &amp;gt;= CurrentDate
        )
    )
&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 09 Jan 2025 17:05:20 GMT</pubDate>
    <dc:creator>Sahir_Maharaj</dc:creator>
    <dc:date>2025-01-09T17:05:20Z</dc:date>
    <item>
      <title>Amount of open orders on each day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-open-orders-on-each-day/m-p/4357600#M172991</link>
      <description>&lt;P&gt;I'm trying to create a measure that calculates the number of orders that are open on each day of the month to place in a bar graph on my dashboard. I used the month of January as an example, but I need it to be for every day of the year.&lt;/P&gt;&lt;P&gt;I have the order number, the start date and the end date. Below I left an example of the table I have, the results I need and how the graph would look.&lt;/P&gt;&lt;P&gt;For example, the first order, Q5466805, I need it to count on days 6, 7, 8 and 9.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 17:04:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-open-orders-on-each-day/m-p/4357600#M172991</guid>
      <dc:creator>dicere</dc:creator>
      <dc:date>2025-01-09T17:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of open orders on each day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-open-orders-on-each-day/m-p/4357607#M172992</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="910491" data-lia-user-login="dicere" class="lia-mention lia-mention-user"&gt;dicere&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please try this approach:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Open Orders = 
VAR CurrentDate = SELECTEDVALUE('Calendar'[Date])
RETURN
    COUNTROWS(
        FILTER(
            'Orders',
            'Orders'[start_date] &amp;lt;= CurrentDate &amp;amp;&amp;amp;
            'Orders'[final_date] &amp;gt;= CurrentDate
        )
    )
&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 09 Jan 2025 17:05:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-open-orders-on-each-day/m-p/4357607#M172992</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2025-01-09T17:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of open orders on each day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-open-orders-on-each-day/m-p/4359220#M173060</link>
      <description>&lt;P&gt;I think this measure is on the way for what I need, but it's still not calculating the correct number.&lt;BR /&gt;I have an active relationship between the calendar table and the orders table. I saw in another topic that there shouldn't be this active relationship between the tables because a relationship between the calendar and orders tables will force the orders table to be filtered by each calendar date due to row context.&lt;BR /&gt;I think this is affecting the measure and not calculating the correct number, but I can't disable this relationship as it will affect other measurements I already have.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;In this topic it was mentioned that it would be possible to use CROSSFILTER() to deactivate this relationship, but I have doubts in which part of the measure I should add CROSSFILTER().&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Basically in this measure I am using the “date” column from the calendar table, and the “start_date” and “end_date” columns from the orders table, but the active relationship is between the “date” column from the calendar table and the “activate_date” column from the table of orders.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Could you help me?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 17:51:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-open-orders-on-each-day/m-p/4359220#M173060</guid>
      <dc:creator>dicere</dc:creator>
      <dc:date>2025-01-10T17:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of open orders on each day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-open-orders-on-each-day/m-p/4359303#M173065</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="910491" data-lia-user-login="dicere" class="lia-mention lia-mention-user"&gt;dicere&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your reponse.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please try this updated approach:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Open Orders = 
VAR CurrentDate = SELECTEDVALUE('Calendar'[Date])
RETURN
    CALCULATE(
        COUNTROWS(
            FILTER(
                'Orders',
                'Orders'[start_date] &amp;lt;= CurrentDate &amp;amp;&amp;amp;
                'Orders'[end_date] &amp;gt;= CurrentDate
            )
        ),
        CROSSFILTER('Calendar'[Date], 'Orders'[activate_date], NONE)
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 19:32:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-open-orders-on-each-day/m-p/4359303#M173065</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2025-01-10T19:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of open orders on each day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-open-orders-on-each-day/m-p/4364622#M173271</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="910491" data-lia-user-login="dicere" class="lia-mention lia-mention-user"&gt;dicere&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your information, I create a table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Create relationship:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then create a new measure,&amp;nbsp;It's like the dax expression described by&amp;nbsp;Sahir_Maharaj&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Open Orders = 
VAR SelectedDate = SELECTEDVALUE('Date'[Date])
RETURN
    CALCULATE(
        COUNTROWS(
            FILTER(
                'Table',
                'Table'[Start Date] &amp;lt;= SelectedDate &amp;amp;&amp;amp;
                'Table'[End Date] &amp;gt;= SelectedDate
            )
        ),
        CROSSFILTER('Date'[Date], 'Table'[Start Date], NONE),
        CROSSFILTER('Date'[Date], 'Table'[End Date], NONE)
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Put then in column chart, here is my preview:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A title="https://community.powerbi.com/t5/community-blog/how-to-get-your-question-answered-quickly/ba-p/38490" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C02%7Cv-yohua%40microsoft.com%7Ce1106bfabecb4734a5cc08dc2305bc51%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638423754744679080%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=24%2BceC5sFd3n3%2FhFDYILWFcNjCwVClBD%2BPBsSLVfJGk%3D&amp;amp;reserved=0" target="_blank" rel="noopener nofollow noreferrer"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yongkang Hua&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2025 08:17:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-open-orders-on-each-day/m-p/4364622#M173271</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-15T08:17:01Z</dc:date>
    </item>
  </channel>
</rss>

