<?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 of the month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/4358719#M173048</link>
    <description>&lt;P&gt;Hello, I'm having difficulty knowing which part of the measure I should use &lt;SPAN&gt;the CROSSFILTER()&lt;/SPAN&gt;.&lt;BR /&gt;The calendar and orders table have an active relationship and I cannot deactivate it as it will disconfigure the other measures.&lt;BR /&gt;Can you help me?&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jan 2025 12:07:19 GMT</pubDate>
    <dc:creator>dicere</dc:creator>
    <dc:date>2025-01-10T12:07:19Z</dc:date>
    <item>
      <title>Amount of Open Orders on each  day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/994718#M12433</link>
      <description>&lt;P&gt;I am not sure if this is possible in DAX but this is my question:&lt;/P&gt;&lt;P&gt;Therefore I created a simple test table with the name POWERBI_TEST_3:&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ORDERNUMBER Unique. The Order starts on one date en had Ended on a date.&lt;/P&gt;&lt;P&gt;I want to know on each day in January 2019 (or more months) how many Orders have de status ‘Open’. The result should look like this, I therefore created a the table with the name DateJanuary with every date in January, a rownumber and a empty column for the numbers of open orders.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created this SQL query to do the job.&lt;/P&gt;&lt;P&gt;In SQL I created a The Query to do the job look like:&lt;/P&gt;&lt;P&gt;DECLARE @COUNTER1 INT&lt;/P&gt;&lt;P&gt;DECLARE &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="189" data-lia-user-login="NR" class="lia-mention lia-mention-user"&gt;NR&lt;/a&gt;_OPEN_ORDERS INT&lt;/P&gt;&lt;P&gt;DECLARE @DATJAN DATE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SET @COUNTER1 = 1&lt;/P&gt;&lt;P&gt;WHILE @COUNTER1 &amp;lt;= (SELECT COUNT(*) FROM Date_January)&lt;/P&gt;&lt;P&gt;BEGIN&lt;/P&gt;&lt;P&gt;SET @DATJAN = (SELECT Date_In_January FROM Date_January WHERE ROW_NMBR = @COUNTER1)&lt;/P&gt;&lt;P&gt;SET &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="189" data-lia-user-login="NR" class="lia-mention lia-mention-user"&gt;NR&lt;/a&gt;_OPEN_ORDERS = (SELECT COUNT(DISTINCT ORDERNUMBER) AS AANTAL FROM POWERBI_TEST_3&lt;/P&gt;&lt;P&gt;WHERE (DATEDIFF(DAY, START_ORDER_DATE, @DATJAN) &amp;gt; 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND DATEDIFF(DAY, @DATJAN, END_ORDER_DATE) &amp;gt; 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (DATEDIFF(DAY, START_ORDER_DATE, END_ORDER_DATE) = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND START_ORDER_DATE = @DATJAN))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UPDATE Date_January&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET NR_OPEN_ORDERS = &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="189" data-lia-user-login="NR" class="lia-mention lia-mention-user"&gt;NR&lt;/a&gt;_OPEN_ORDERS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE Date_In_January = @DATJAN&lt;/P&gt;&lt;P&gt;SET @COUNTER1 = @COUNTER1 + 1&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The end result looks like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;In the SQL query I look at every record step by step per rownnumber. I don’t know if this is possible in DAX (or Power Query).&lt;/P&gt;&lt;P&gt;For some reason it’s not possible for me to use this SQL query. I am looking for a solution in PowerBI itself.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 06:47:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/994718#M12433</guid>
      <dc:creator>RvdC</dc:creator>
      <dc:date>2020-03-27T06:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of Open Orders on each  day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/994743#M12434</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="215642" data-lia-user-login="RvdC" class="lia-mention lia-mention-user"&gt;RvdC&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;_openOrders = 
VAR date_to_examine =
    MAX('calendar'[Date])
VAR number_orders =
    CALCULATE(
        DISTINCTCOUNT(orders[orderNumber]),
        KEEPFILTERS(date_to_examine &amp;gt; orders[startDate]),
        KEEPFILTERS(date_to_examine &amp;lt; orders[enddate])
    )
RETURN
    IF (ISBLANK(number_orders), 0, number_orders)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the following output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*NB* The calendar table DOES NOT/MUST NOT have a relationship with the orders table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 11:02:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/994743#M12434</guid>
      <dc:creator>BA_Pete</dc:creator>
      <dc:date>2020-03-27T11:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of Open Orders on each  day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/995158#M12445</link>
      <description>&lt;P&gt;First off, this is the set-based T-SQL that does all of this at least an order of magnitude faster than the procedural code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;	UPDATE jan
	SET
		  jan.NR_OPEN_ORDERS = c.OrderCount

	FROM dbo.Date_January AS jan
	CROSS APPLY (
		SELECT
			count(*) AS OrderCount
		FROM dbo.PowerBI_test_3 AS pbi
		WHERE (
			pbi.Start_Order_Date &amp;lt;= jan.[Date_in_Jan]
			and
			jan.[Date_in_Jan] &amp;lt;= pbi.End_Order_Date
		)
	) AS c;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Secondly, if you have a PBI table with dates, say, Calendar, and want to know the number of open order on each day, you create a calculated column in Calendar with this formula:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[Open Orders] =
var __date = 'Calendar'[Date]
var __orderCount =
	COUNTROWS(
		filter(
			'Orders',
			'Orders'[start_order_date] &amp;lt;= __date
			&amp;amp;&amp;amp;
			__date &amp;lt;= 'Orders'[end_order_date]
		)
	)	
return
	0 + __orderCount&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 11:02:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/995158#M12445</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-27T11:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of Open Orders on each  day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/996955#M12559</link>
      <description>&lt;P&gt;Many thanks for the query and DAX script. I was not familiar with APPLY operators. Great to know now. DAX query also runs fine.&lt;/P&gt;&lt;P&gt;Regards Rob&lt;/P&gt;</description>
      <pubDate>Sun, 29 Mar 2020 11:07:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/996955#M12559</guid>
      <dc:creator>RvdC</dc:creator>
      <dc:date>2020-03-29T11:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of Open Orders on each  day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/996959#M12560</link>
      <description>&lt;P&gt;Thanks for the quick answer! I have tried the DAX script in Power BI on my Dummy dataset. It got only zeros as output in the added _openOrder2 column.&lt;/P&gt;&lt;P&gt;Maybe I overlooked something in the script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;_openOrders2 = VAR date_to_examine = MAX('Date_January_2'[Date_In_January]) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR number_orders = CALCULATE( DISTINCTCOUNT(POWERBI_TEST_3[ORDERNUMBER]); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;KEEPFILTERS(date_to_examine &amp;gt; POWERBI_TEST_3[START_ORDER_DATE]); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;KEEPFILTERS(date_to_examine &amp;lt; POWERBI_TEST_3[END_ORDER_DATE]) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN IF (ISBLANK(number_orders); 0; number_orders)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Best,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RVDC&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 29 Mar 2020 11:23:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/996959#M12560</guid>
      <dc:creator>RvdC</dc:creator>
      <dc:date>2020-03-29T11:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of Open Orders on each  day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/996968#M12561</link>
      <description>My code is for a calculated column. It's not a measure. If your code is for a calculated column, then it's wrong. If it's a measure, then... it's most likely wrong as well (because of relationships).&lt;BR /&gt;&lt;BR /&gt;Advice: never use a function in DAX if you don't know how it works. CALCULATE does context transition, therefore your formula is almost certainly wrong.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;d</description>
      <pubDate>Sun, 29 Mar 2020 11:36:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/996968#M12561</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-29T11:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of Open Orders on each  day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/997050#M12566</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="215642" data-lia-user-login="RvdC" class="lia-mention lia-mention-user"&gt;RvdC&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DAX I provided was for a measure as stated, not a calculated column. Apologies if I've misunderstood your requirement here.&lt;/P&gt;&lt;P&gt;It does, however, provide the output you were looking for when applied to visualisations.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Mar 2020 14:00:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/997050#M12566</guid>
      <dc:creator>BA_Pete</dc:creator>
      <dc:date>2020-03-29T14:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of Open Orders on each  day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/2469053#M67166</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I have just confirmed that the solution to all my problems is to not link the calendar table to the table I am getting the info about the open items from like you said before, but I don't understand why. Can you explain why is that the solution, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 12:51:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/2469053#M67166</guid>
      <dc:creator>Roberto_Campelo</dc:creator>
      <dc:date>2022-04-21T12:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of Open Orders on each  day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/2469159#M67174</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="380666" data-lia-user-login="Roberto_Campelo" class="lia-mention lia-mention-user"&gt;Roberto_Campelo&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is 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;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, if there is a relationship between calendar[date] and orders[start date], and if the calendar date on the row is 01/01/2022, then this filters the order table to only rows where [start date] = 01/01/2022. This prevents us from being able to evaluate our measure across the full range of [start date] and [end date] values, as we need to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are a couple of ways around this other than using a disconnected date table:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- You can use the CROSSFILTER() function to 'switch off' the relationship (much like USERELATIONSHIP() 'switches on' relationships).&lt;/P&gt;
&lt;P&gt;OR&lt;/P&gt;
&lt;P&gt;- You can use functions like ALL(), ALLEXCEPT() etc. to reopen up all the values that have been filtered out by the relationship.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pete&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 13:32:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/2469159#M67174</guid>
      <dc:creator>BA_Pete</dc:creator>
      <dc:date>2022-04-21T13:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of Open Orders on each  day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/2471268#M67293</link>
      <description>&lt;P&gt;Hi Pete,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your explanation, it was really useful. Since I need to keep the relationship through the date, I used the CROSSFILTER() function and it worked perfectly. And now I understand how this row context works.&lt;/P&gt;&lt;P&gt;Roberto&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 10:38:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/2471268#M67293</guid>
      <dc:creator>Roberto_Campelo</dc:creator>
      <dc:date>2022-04-22T10:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of Open Orders on each  day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/4358719#M173048</link>
      <description>&lt;P&gt;Hello, I'm having difficulty knowing which part of the measure I should use &lt;SPAN&gt;the CROSSFILTER()&lt;/SPAN&gt;.&lt;BR /&gt;The calendar and orders table have an active relationship and I cannot deactivate it as it will disconfigure the other measures.&lt;BR /&gt;Can you help me?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 12:07:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/4358719#M173048</guid>
      <dc:creator>dicere</dc:creator>
      <dc:date>2025-01-10T12:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of Open Orders on each  day of the month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/4360914#M173120</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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would wrap the whole calculation in another CALCULATE and use CROSSFILTER there.&lt;/P&gt;
&lt;P&gt;Based on the initial measure I provided, it would be something like this:&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;_openOrders = 
VAR date_to_examine =
    MAX('calendar'[Date])
VAR number_orders =
    CALCULATE(  // New CALCULATE wrapper
        CALCULATE(
            DISTINCTCOUNT(orders[orderNumber]),
            KEEPFILTERS(date_to_examine &amp;gt; orders[startDate]),
            KEEPFILTERS(date_to_examine &amp;lt; orders[enddate])
        ),
        CROSSFILTER(orders[orderNumber], 'calendar'[Date], none)  // Remove crossfilter
    )
RETURN
    IF (ISBLANK(number_orders), 0, number_orders)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pete&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2025 06:50:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-Open-Orders-on-each-day-of-the-month/m-p/4360914#M173120</guid>
      <dc:creator>BA_Pete</dc:creator>
      <dc:date>2025-01-13T06:50:49Z</dc:date>
    </item>
  </channel>
</rss>

