<?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: Dax Measure to determine Active versus Inactive Clients for like-for-like comparisons in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measure-to-determine-Active-versus-Inactive-Clients-for-like/m-p/4080048#M161968</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="770280" data-lia-user-login="karleek" class="lia-mention lia-mention-user"&gt;karleek&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you solved your problem? If not, is it possible to provide some of the example data and the output you expect.&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 _Charlotte&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Aug 2024 06:30:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-08-05T06:30:09Z</dc:date>
    <item>
      <title>Dax Measure to determine Active versus Inactive Clients for like-for-like comparisons</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measure-to-determine-Active-versus-Inactive-Clients-for-like/m-p/4076601#M161872</link>
      <description>&lt;P&gt;I have a measure to create a table to determine which clients are active based on if they have orders within a specific month &amp;amp; year. Here is the measure creating this table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All Customer =&lt;/P&gt;&lt;P&gt;var AllCustomer =&lt;/P&gt;&lt;P&gt;CROSSJOIN(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ALLNOBLANKROW('Date'[Year]), 'Date'[Year]),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ALLNOBLANKROW('Date'[Month], 'Date'[Month]),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ALLNOBLANKROW('Customer Table'[Final Business ID]))&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var LiveCustomer =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUMMARIZE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'New Exchange Info','Date'[Year],'Date'[Month],'Customer Table'[Final Business ID])&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; var Result =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; UNION(ADDCOLUMNS(LiveCustomer, "Status", "Live"),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ADDCOLUMNS(EXCEPT(AllCustomer, LiveCustomer), "Status", "InActive"))&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Return&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This measure below is ALMOST working properly, but there are couple issues as following:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1. It is calling all clients Inactive for Aug - December since those month haven't occured yet and therefore there are no orders for those months&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2. My like-for-like measures is expecting a client to be Active for the entire year in order to show in my comparison charts when really I just want it to look at if they were active for the "previous same period"&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;An example of the like-for-like measure calculating all orders is as follows:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Same Customer Orders =&lt;/P&gt;&lt;P&gt;var LiveCustomer =&lt;/P&gt;&lt;P&gt;CALCULATETABLE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; FILTER(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ALLSELECTED('Customer Table'[Final Business ID),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SELECTEDVALUE('All Customer'[Status])&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ) = "Live"),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ALLSELECTED('Date'))&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var FilterCustomer =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TREATAS(LiveCustomer, 'Customer Table'[Final Business ID])&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var Result =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [Total Orders],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; KEEPFILTERS(filterCustomer))&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Return&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Result&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any help in tweaking these measures. to accomplish what I need would be much appreciated. Thanks!&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="362560" data-lia-user-login="Ahmedx" class="lia-mention lia-mention-user"&gt;Ahmedx&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="15697" data-lia-user-login="danextian" class="lia-mention lia-mention-user"&gt;danextian&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 17:58:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measure-to-determine-Active-versus-Inactive-Clients-for-like/m-p/4076601#M161872</guid>
      <dc:creator>karleek</dc:creator>
      <dc:date>2024-08-02T17:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Measure to determine Active versus Inactive Clients for like-for-like comparisons</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measure-to-determine-Active-versus-Inactive-Clients-for-like/m-p/4076706#M161877</link>
      <description>&lt;P&gt;I'm not fully understanding how you intend to use the measure. Same customer orders as what?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, did an AI write these measures? They seem overly convoluted to me. I think you could combine both All Customer and Same Customer Orders into a single measure like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;Live Customer Orders =

VAR EndDate = EOMONTH ( TODAY (), -1 )

VAR MonthsSelected =
    CALCULATE (
        COUNTROWS ( SUMMARIZE ( 'Date', 'Date'[Year], 'Date'[Month] ) ),
        'Date'[Date] &amp;lt;= EndDate
    )

VAR CustomerMonths =
    CALCULATETABLE (
        SUMMARIZE ( 'New Exchange Info', 'Customer'[ID], 'Date'[Year], 'Date'[Month] ),
        'Date'[Date] &amp;lt;= EndDate
    )

VAR LiveCustomers =
    FILTER (
        DISTINCT ( 'Customer'[ID] ),
        COUNTROWS (
            FILTER ( CustomerMonths, 'Customer'[ID] = EARLIER ( 'Customer'[ID] ) )
        ) = MonthsSelected
    )

VAR Result = CALCULATE ( [Total Orders], KEEPFILTERS ( LiveCustomers ) )

RETURN
    Result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 20:37:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measure-to-determine-Active-versus-Inactive-Clients-for-like/m-p/4076706#M161877</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2024-08-02T20:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Measure to determine Active versus Inactive Clients for like-for-like comparisons</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measure-to-determine-Active-versus-Inactive-Clients-for-like/m-p/4076710#M161879</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp; thanks for the reply, no AI didn't write it, I found the measure examples on this article&amp;nbsp;&lt;A href="https://www.daxpatterns.com/like-for-like-comparison/" target="_blank"&gt;https://www.daxpatterns.com/like-for-like-comparison/&lt;/A&gt;&amp;nbsp;I am new to Power BI and just trying to learn it based on the desired reporting outputs needed, so very much a trial and error experience over here.&lt;BR /&gt;&lt;BR /&gt;I am testing about what you provided above, but what is supposed to go in the [@monthslive]?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 19:12:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measure-to-determine-Active-versus-Inactive-Clients-for-like/m-p/4076710#M161879</guid>
      <dc:creator>karleek</dc:creator>
      <dc:date>2024-08-02T19:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Measure to determine Active versus Inactive Clients for like-for-like comparisons</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measure-to-determine-Active-versus-Inactive-Clients-for-like/m-p/4076804#M161893</link>
      <description>&lt;P&gt;It should be MonthsSelected (I rewrote the measures a couple of times and this was a vestige of an earlier version). I will correct it.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 20:38:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measure-to-determine-Active-versus-Inactive-Clients-for-like/m-p/4076804#M161893</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2024-08-02T20:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dax Measure to determine Active versus Inactive Clients for like-for-like comparisons</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measure-to-determine-Active-versus-Inactive-Clients-for-like/m-p/4080048#M161968</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="770280" data-lia-user-login="karleek" class="lia-mention lia-mention-user"&gt;karleek&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you solved your problem? If not, is it possible to provide some of the example data and the output you expect.&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 _Charlotte&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 06:30:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Measure-to-determine-Active-versus-Inactive-Clients-for-like/m-p/4080048#M161968</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-05T06:30:09Z</dc:date>
    </item>
  </channel>
</rss>

