<?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: New customers per service unit in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-customers-per-service-unit/m-p/3218469#M117561</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;all mentioned columns are in the same table or have relationship.&lt;/P&gt;</description>
    <pubDate>Wed, 03 May 2023 17:58:08 GMT</pubDate>
    <dc:creator>josimarjr</dc:creator>
    <dc:date>2023-05-03T17:58:08Z</dc:date>
    <item>
      <title>New customers per service unit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-customers-per-service-unit/m-p/3216300#M117440</link>
      <description>&lt;P&gt;I need to create a measure to identify new customers by service unit.&lt;/P&gt;&lt;P&gt;I made the measurement below, but in some cases the customer returns as new, but the customer has already bought it at another store in the group.&lt;/P&gt;&lt;P&gt;I need that when filtering the store, it is checked if the customer has already purchased from another store in the group. If the customer has a purchase in another store of the same group, do not consider it as new.&lt;/P&gt;&lt;P&gt;Filters used for return:&lt;BR /&gt;- Date of Purchase&lt;BR /&gt;- Service Unit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Qty_New_Customers =&lt;BR /&gt;COUNTROWS(&lt;BR /&gt;FILTER(&lt;BR /&gt;ADDCOLUMNS(VALUES(PURCHASES[Customer Code]),&lt;BR /&gt;"New clients",&lt;BR /&gt;CALCULATE(COUNTROWS(PURCHASE),FILTER(ALL(PURCHASE_DATE),PURCHASE_DATE[Purchase_Date]&amp;lt;MIN(PURCHASE_DATE[Purchase_Date])))),&lt;BR /&gt;[New Customers] = 0))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex: When filtering the month of April/2023 and unit B, the measure returns customer 1002732 as new (First Purchase), but in fact the customer had already purchased from another unit in the group in February/2023.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Customer_Code&lt;/TD&gt;&lt;TD&gt;Purchase_Code&lt;/TD&gt;&lt;TD&gt;Purchase_Date&lt;/TD&gt;&lt;TD&gt;Service_Unit&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1002732&lt;/TD&gt;&lt;TD&gt;32620104&lt;/TD&gt;&lt;TD&gt;07/02/2023&lt;/TD&gt;&lt;TD&gt;Unit A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1002732&lt;/TD&gt;&lt;TD&gt;32620104&lt;/TD&gt;&lt;TD&gt;08/02/2023&lt;/TD&gt;&lt;TD&gt;Unit A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;1002732&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;32620104&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;10/04/2023&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Unit B&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 18:24:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-customers-per-service-unit/m-p/3216300#M117440</guid>
      <dc:creator>josimarjr</dc:creator>
      <dc:date>2023-05-02T18:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: New customers per service unit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-customers-per-service-unit/m-p/3216850#M117460</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hard to know for sure this will work since you've shared nothing about your data model (that cannot be inferred from your measure), but what if you add a second filter parameter "REMOVEFILTERS ( Service_Unit )" to your "New Clients" CALCULATE function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that doesn't work, please share a pbix.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;----------------------------------&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 01:33:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-customers-per-service-unit/m-p/3216850#M117460</guid>
      <dc:creator>Wilson_</dc:creator>
      <dc:date>2023-05-03T01:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: New customers per service unit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-customers-per-service-unit/m-p/3218469#M117561</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;all mentioned columns are in the same table or have relationship.&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 17:58:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-customers-per-service-unit/m-p/3218469#M117561</guid>
      <dc:creator>josimarjr</dc:creator>
      <dc:date>2023-05-03T17:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: New customers per service unit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-customers-per-service-unit/m-p/3218624#M117575</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this once!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 20:10:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-customers-per-service-unit/m-p/3218624#M117575</guid>
      <dc:creator>Ajendra</dc:creator>
      <dc:date>2023-05-03T20:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: New customers per service unit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-customers-per-service-unit/m-p/3219039#M117602</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="554579" data-lia-user-login="josimarjr" class="lia-mention lia-mention-user"&gt;josimarjr&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Please create a new measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;New_Customers_Number = 
VAR _mindate =
    CALCULATE (
        MIN ( 'PURCHASE_DATE'[Purchase_Date] ),
        ALL ( 'PURCHASE'[Service_Unit] )
    )
VAR _table_1 =
    CALCULATETABLE (
        VALUES ( 'PURCHASE'[Customer_Code] ),
        FILTER ( ALL ( 'PURCHASE_DATE' ), 'PURCHASE_DATE'[Purchase_Date] &amp;lt; _mindate )
    )
VAR _table_2 =
    CALCULATETABLE ( VALUES ( 'PURCHASE'[Customer_Code] ), ALLSELECTED () )
VAR _result =
    COUNTROWS ( EXCEPT ( _table_2, _table_1 ) ) + 0
RETURN
    _result&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Best Regards,&lt;BR /&gt;Gao&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;Community Support Team&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;If there is any post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT size="3" color="#008080"&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT size="3"&gt;&lt;FONT color="#008080"&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#008080"&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT size="3"&gt;Thanks a lot!&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2" color="#FF0000"&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;How to get your questions answered quickly&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;--&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 02:39:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-customers-per-service-unit/m-p/3219039#M117602</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-04T02:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: New customers per service unit</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-customers-per-service-unit/m-p/3224927#M118072</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for his input, but it still didn't work out.&lt;/P&gt;&lt;P&gt;Using your example to meet my need, the customer should be considered as new on 07/02/2023 (date of first purchase).&lt;/P&gt;&lt;P&gt;I think there's just one small detail missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Customer_Code&lt;/TD&gt;&lt;TD&gt;Purchase_Date&lt;/TD&gt;&lt;TD&gt;Service_Unit&lt;/TD&gt;&lt;TD&gt;New_Customers_Number&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1002732&lt;/TD&gt;&lt;TD&gt;07/02/2023 00:00&lt;/TD&gt;&lt;TD&gt;Unit A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1002732&lt;/TD&gt;&lt;TD&gt;08/02/2023 00:00&lt;/TD&gt;&lt;TD&gt;Unit A&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1002733&lt;/TD&gt;&lt;TD&gt;15/04/2023 00:00&lt;/TD&gt;&lt;TD&gt;Unit A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 12:33:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-customers-per-service-unit/m-p/3224927#M118072</guid>
      <dc:creator>josimarjr</dc:creator>
      <dc:date>2023-05-08T12:33:06Z</dc:date>
    </item>
  </channel>
</rss>

