<?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: Calculate fulfilled + open thru current month only in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fulfilled-open-thru-current-month-only/m-p/980899#M11987</link>
    <description>&lt;P&gt;Should be along the lines of:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Measure =&lt;/P&gt;
&lt;P&gt;&amp;nbsp; IF(&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; MAX([Date]) &amp;lt;= EOMONTH(TODAY(),0),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;do some calculation&amp;gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; BLANK()&lt;/P&gt;
&lt;P&gt;&amp;nbsp; )&lt;/P&gt;</description>
    <pubDate>Wed, 18 Mar 2020 23:23:36 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2020-03-18T23:23:36Z</dc:date>
    <item>
      <title>Calculate fulfilled + open thru current month only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fulfilled-open-thru-current-month-only/m-p/980709#M11981</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an Orders table with [Qty Shipped] and [Qty Open].&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to provide a line graph and matrix that only show values thru the &lt;EM&gt;current&lt;/EM&gt; month based on today (pic 1). These values should include any open orders for the current month. I want this to happen dynamically instead of having to use a date slicer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I cannot figure out how to get&amp;nbsp;&lt;EM&gt;next&amp;nbsp;&lt;/EM&gt;month to be excluded from a calculation (pic 2).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working in a Direct Query model, so I can only write measures --- Do I need to have a calculated column created?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help!&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;Pic 1 (goal):&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;Pic 2 (current issue):&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 19:46:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fulfilled-open-thru-current-month-only/m-p/980709#M11981</guid>
      <dc:creator>abristow</dc:creator>
      <dc:date>2020-03-18T19:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate fulfilled + open thru current month only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fulfilled-open-thru-current-month-only/m-p/980899#M11987</link>
      <description>&lt;P&gt;Should be along the lines of:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Measure =&lt;/P&gt;
&lt;P&gt;&amp;nbsp; IF(&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; MAX([Date]) &amp;lt;= EOMONTH(TODAY(),0),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;do some calculation&amp;gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; BLANK()&lt;/P&gt;
&lt;P&gt;&amp;nbsp; )&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 23:23:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fulfilled-open-thru-current-month-only/m-p/980899#M11987</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-18T23:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate fulfilled + open thru current month only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fulfilled-open-thru-current-month-only/m-p/982146#M12008</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;thank you! That did the trick. One follow-up question...is there any way to make the YTD total show up on the right side of the table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;</description>
      <pubDate>Thu, 19 Mar 2020 14:10:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fulfilled-open-thru-current-month-only/m-p/982146#M12008</guid>
      <dc:creator>abristow</dc:creator>
      <dc:date>2020-03-19T14:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate fulfilled + open thru current month only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fulfilled-open-thru-current-month-only/m-p/982196#M12011</link>
      <description>&lt;P&gt;Ah yes, the total line.&amp;nbsp;It's measure totals problem. Very common. See my post about it here: &lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376.&amp;nbsp;Also" target="_blank"&gt;https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376.&amp;nbsp;Also&lt;/A&gt;, this Quick Measure, Measure Totals, The Final Word might get you what you need:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, in your case I think we could do something simple like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  VAR __Total = COUNTROWS('Table') = COUNTROWS(ALL('Table'))
RETURN
  IF(
    
    MAX([Date]) &amp;lt;= EOMONTH(TODAY(),0) || __Total,

    &amp;lt;do some calculation&amp;gt;,

    BLANK()

  )&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 19 Mar 2020 14:04:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fulfilled-open-thru-current-month-only/m-p/982196#M12011</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-19T14:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate fulfilled + open thru current month only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fulfilled-open-thru-current-month-only/m-p/989145#M12241</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;just getting around to trying this. I'm green enough in DAX that I don't totally comprehend how it worked...but it did and I greatly appreciate your help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 14:41:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fulfilled-open-thru-current-month-only/m-p/989145#M12241</guid>
      <dc:creator>abristow</dc:creator>
      <dc:date>2020-03-24T14:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate fulfilled + open thru current month only</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fulfilled-open-thru-current-month-only/m-p/989177#M12242</link>
      <description>&lt;P&gt;Great&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="126897" data-lia-user-login="abristow" class="lia-mention lia-mention-user"&gt;abristow&lt;/a&gt;&amp;nbsp;- here is an explanation. Code below for ease of reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;__Table - What this is doing is counting the rows within the current context and comparing it to the count of rows with all context removed. In your case, these are only equal (return of TRUE) in the Grand Total row so probably superfluous to your situation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The other check gets the MAX of the date within the current context and compares it to the end of the current month's date. So, for you row total, the max of the date within the current context is going to be some date in March and so this forces the calculation to occur.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, specifically why it actually works in your case, well, I technically have no idea why it wasn't working because I have no idea what your measure is! But apparently it was some kind of calculation that was returning blank in the 2020 row total row and this apparently fixed that issue. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;Measure =
  VAR __Total = COUNTROWS('Table') = COUNTROWS(ALL('Table'))
RETURN
  IF(
    
    MAX([Date]) &amp;lt;= EOMONTH(TODAY(),0) || __Total,

    &amp;lt;do some calculation&amp;gt;,

    BLANK()

  )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 14:57:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fulfilled-open-thru-current-month-only/m-p/989177#M12242</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-24T14:57:34Z</dc:date>
    </item>
  </channel>
</rss>

