<?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: Using active and inactive in one measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2636790#M77321</link>
    <description>&lt;P&gt;Try the below in DAX Studio&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DEFINE
    VAR mtd =
        DATESMTD ( 'Calendar'[Date] )

EVALUATE
CALCULATETABLE (
    'Table',
    TREATAS ( mtd, 'Table'[Order date] ),
    TREATAS ( mtd, 'Table'[Delivery date] )
)&lt;/LI-CODE&gt;&lt;P&gt;That will show the rows which are being summed up. If you compare that to the rows which you think should be included you might be able to see any critical differences&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jul 2022 15:25:24 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2022-07-13T15:25:24Z</dc:date>
    <item>
      <title>Using active and inactive in one measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2636669#M77313</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is a simplified example of the dataset showing the orders with an order date and a date for requisted delivery.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example data:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;order date and requested delivery date are connected with a calendar:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I need a measure that fullfils the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Turnover (month to date is important) summed up&lt;/LI&gt;&lt;LI&gt;with order date in current month (MTD)&lt;/LI&gt;&lt;LI&gt;with requested delivery in current month&amp;nbsp;(MTD)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Until now I managed how to create a measure with either order date MTD or requested delivery date MTD (with userrelationshop to use the inactive connection), but not both at the same time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you guys help me?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 14:52:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2636669#M77313</guid>
      <dc:creator>bendejnp</dc:creator>
      <dc:date>2022-07-13T14:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using active and inactive in one measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2636721#M77316</link>
      <description>&lt;P&gt;You could try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Turnover MTD = 
var mtd = DATESMTD( 'Calendar'[Date])
return CALCULATE( SUM('Table'[Turnover]),
TREATAS( mtd, 'Table'[Order date]),
TREATAS( mtd, 'Table'[Delivery date])
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 13 Jul 2022 14:55:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2636721#M77316</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-07-13T14:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using active and inactive in one measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2636763#M77319</link>
      <description>&lt;P&gt;I tried it and it gives a figure, but it's much too low. Unfortunately I couldn't find out which part of data it slices. Any idea?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 15:18:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2636763#M77319</guid>
      <dc:creator>bendejnp</dc:creator>
      <dc:date>2022-07-13T15:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using active and inactive in one measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2636786#M77320</link>
      <description>&lt;P&gt;Update: Ok I found out it works only for the selected day, but it does not sum up month to date. So this part seems not to work:&lt;/P&gt;&lt;PRE&gt;var mtd = DATESMTD( 'Calendar'[Date])&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 15:25:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2636786#M77320</guid>
      <dc:creator>bendejnp</dc:creator>
      <dc:date>2022-07-13T15:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using active and inactive in one measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2636790#M77321</link>
      <description>&lt;P&gt;Try the below in DAX Studio&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DEFINE
    VAR mtd =
        DATESMTD ( 'Calendar'[Date] )

EVALUATE
CALCULATETABLE (
    'Table',
    TREATAS ( mtd, 'Table'[Order date] ),
    TREATAS ( mtd, 'Table'[Delivery date] )
)&lt;/LI-CODE&gt;&lt;P&gt;That will show the rows which are being summed up. If you compare that to the rows which you think should be included you might be able to see any critical differences&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 15:25:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2636790#M77321</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-07-13T15:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using active and inactive in one measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2636815#M77323</link>
      <description>&lt;P&gt;Hmm, that could just be DAX Studio not having a context for the dates, where your report actually does.&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DEFINE
    VAR mtd =
        CALCULATETABLE (
            DATESMTD ( 'Calendar'[Date] ),
            TREATAS ( { TODAY () }, 'Calendar'[Date] )
        )

EVALUATE
CALCULATETABLE (
    'Table',
    TREATAS ( mtd, 'Table'[Order date] ),
    TREATAS ( mtd, 'Table'[Delivery date] )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 13 Jul 2022 15:31:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2636815#M77323</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-07-13T15:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using active and inactive in one measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2636838#M77327</link>
      <description>&lt;P&gt;Sorry my last post was not regarding DAX studio. I was typing whilst you already answered. I don't have DAX studio and cannot install on my business laptop.&lt;BR /&gt;&lt;BR /&gt;However I found out the formula shows only the lines order date of the selected calendar day. Example:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The measure shows 435€, but it should shows 1690.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 15:40:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2636838#M77327</guid>
      <dc:creator>bendejnp</dc:creator>
      <dc:date>2022-07-13T15:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using active and inactive in one measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2636862#M77329</link>
      <description>&lt;P&gt;OK, try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Turnover MTD = 
var mtd = DATESMTD( 'Calendar'[Date])
return CALCULATE( SUM('Table'[Turnover]),
REMOVEFILTERS('Calendar'),
TREATAS( mtd, 'Table'[Order date]),
TREATAS( mtd, 'Table'[Delivery date])
)&lt;/LI-CODE&gt;&lt;P&gt;You may need to alter the REMOVEFILTERS if the order day &amp;amp; month aren't coming from the Calendar table.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 15:55:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2636862#M77329</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-07-13T15:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using active and inactive in one measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2644736#M77784</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="384064" data-lia-user-login="bendejnp" class="lia-mention lia-mention-user"&gt;bendejnp&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may try this Measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Turnover MTD =
VAR Today_ =
    TODAY ()
VAR FirstDayOfMonth =
    DATE ( YEAR ( Today_ ), MONTH ( Today_ ), 1 )
RETURN
    CALCULATE (
        SUM ( 'Append'[Turnover] ),
        FILTER (
            'Append',
            'Append'[Order Date(YYYY/MM/DD)] &amp;gt;= FirstDayOfMonth
                &amp;amp;&amp;amp; 'Append'[Requested Delivery Date(YYYY/MM/DD)] &amp;gt;= FirstDayOfMonth
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sample data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result looks like this.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, attached the pbix file as reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post helps, then please consider&lt;STRONG&gt; Accept it as the solution&lt;/STRONG&gt; to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _ Caiyun&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 11:29:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2644736#M77784</guid>
      <dc:creator>v-cazheng-msft</dc:creator>
      <dc:date>2022-07-18T11:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using active and inactive in one measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2646743#M77883</link>
      <description>&lt;P&gt;With the suggested change it works now. Thank you!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;However, I didn't understand which the "removefilter" has and why I have to use it here&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 07:25:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2646743#M77883</guid>
      <dc:creator>bendejnp</dc:creator>
      <dc:date>2022-07-19T07:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using active and inactive in one measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2647003#M77890</link>
      <description>&lt;P&gt;REMOVEFILTERS is to make sure that nothing is being filtered out by any slicers or filters applied to the calendar table.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 08:32:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2647003#M77890</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-07-19T08:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using active and inactive in one measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2647129#M77892</link>
      <description>&lt;P&gt;Ok I see. So since the latest day is selected in the dashboard, it will only sum up the selected day. Thanks for the explanation.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 09:03:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-active-and-inactive-in-one-measure/m-p/2647129#M77892</guid>
      <dc:creator>bendejnp</dc:creator>
      <dc:date>2022-07-19T09:03:35Z</dc:date>
    </item>
  </channel>
</rss>

