<?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: Know how many users news repeat an order in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Know-how-many-users-news-repeat-an-order/m-p/3493487#M133802</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="302954" data-lia-user-login="ATO23" class="lia-mention lia-mention-user"&gt;ATO23&lt;/a&gt;&amp;nbsp;check content on the link for start&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.daxpatterns.com/new-and-returning-customers/" target="_self"&gt;https://www.daxpatterns.com/new-and-returning-customers/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Oct 2023 09:42:26 GMT</pubDate>
    <dc:creator>some_bih</dc:creator>
    <dc:date>2023-10-24T09:42:26Z</dc:date>
    <item>
      <title>Know how many users news repeat an order</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Know-how-many-users-news-repeat-an-order/m-p/3493438#M133798</link>
      <description>&lt;P&gt;Good morning everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm facing a problem in my power BI model and I'm looking for some help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a customer table where I have all the customer ID with every transaction (order) they made during a period. So I have one line per transaction. I also have a column to know if is the first time a customer is purchasing with a boolean of Y/N.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem I'm facing is that if I want to know the NEW customers I have in my table, I just need to do a calculate with a filter = Y in the column where I notice if it's the first purchase; however, I want to know how many times a NEW customer bought me in a filter date selection.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, a customer buys for the first time in May 2023, and makes another purchase in July 2023. I want to know, that user is new and he did 2 purchases in that period.&amp;nbsp; If I apply a filter in the page to know all the users news, I miss that second purchase that have a N in the first purchase column, and I don't want to lose it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 09:21:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Know-how-many-users-news-repeat-an-order/m-p/3493438#M133798</guid>
      <dc:creator>ATO23</dc:creator>
      <dc:date>2023-10-24T09:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Know how many users news repeat an order</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Know-how-many-users-news-repeat-an-order/m-p/3493487#M133802</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="302954" data-lia-user-login="ATO23" class="lia-mention lia-mention-user"&gt;ATO23&lt;/a&gt;&amp;nbsp;check content on the link for start&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.daxpatterns.com/new-and-returning-customers/" target="_self"&gt;https://www.daxpatterns.com/new-and-returning-customers/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 09:42:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Know-how-many-users-news-repeat-an-order/m-p/3493487#M133802</guid>
      <dc:creator>some_bih</dc:creator>
      <dc:date>2023-10-24T09:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Know how many users news repeat an order</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Know-how-many-users-news-repeat-an-order/m-p/3494707#M133868</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="302954" data-lia-user-login="ATO23" class="lia-mention lia-mention-user"&gt;ATO23&lt;/a&gt;&amp;nbsp;, here is my suggested solution. Instead of a page-level filter, create the measures needed which do the filtering required.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used this set of test data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;CustomerID&lt;/TD&gt;&lt;TD&gt;orderID&lt;/TD&gt;&lt;TD&gt;period&lt;/TD&gt;&lt;TD&gt;order_value&lt;/TD&gt;&lt;TD&gt;new_customer&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C001&lt;/TD&gt;&lt;TD&gt;O001&lt;/TD&gt;&lt;TD&gt;01/05/2023&lt;/TD&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;TD&gt;Y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C001&lt;/TD&gt;&lt;TD&gt;O002&lt;/TD&gt;&lt;TD&gt;01/07/2023&lt;/TD&gt;&lt;TD&gt;2345&lt;/TD&gt;&lt;TD&gt;N&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C002&lt;/TD&gt;&lt;TD&gt;O003&lt;/TD&gt;&lt;TD&gt;01/05/2023&lt;/TD&gt;&lt;TD&gt;3274&lt;/TD&gt;&lt;TD&gt;Y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C003&lt;/TD&gt;&lt;TD&gt;O004&lt;/TD&gt;&lt;TD&gt;01/07/2023&lt;/TD&gt;&lt;TD&gt;2874&lt;/TD&gt;&lt;TD&gt;Y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C004&lt;/TD&gt;&lt;TD&gt;O005&lt;/TD&gt;&lt;TD&gt;01/07/2023&lt;/TD&gt;&lt;TD&gt;2774&lt;/TD&gt;&lt;TD&gt;N&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a measure called [&lt;SPAN&gt;New Customers]:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;New Customers = CALCULATE(DISTINCTCOUNT(YourTable[CustomerID]), YourTable[new_customer] = "Y")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Create a measure called [New Customer Orders]:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;New Customer Orders = 
    VAR cust = SUMMARIZE(
        FILTER(YourTable, YourTable[new_customer] = "Y"),
        YourTable[CustomerID]
    )
    VAR orders = CALCULATE(
        COUNTROWS(YourTable),
        ALL(YourTable),
        YourTable[CustomerID] IN cust
    )
    
    RETURN orders
    &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add a slicer to your report, using the [period] field.&lt;/P&gt;&lt;P&gt;Add a Card visual to your report, and drag in the [New Customers] measure.&lt;/P&gt;&lt;P&gt;Add a Card visual to your report, and drag in the [New Customer Orders] measure.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This gives me the following results when May-23 is selected.&lt;/P&gt;&lt;P&gt;There are 2 new customers in May-23 (C001 and C002).&lt;/P&gt;&lt;P&gt;Of those two new customers, there are 3 total orders in the table (O001, 002 and O003).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This gives me the following results when Jul-23 is selected.&lt;/P&gt;&lt;P&gt;There is 1 new customers in Jul-23 (C003).&lt;/P&gt;&lt;P&gt;Of that new customer, there is 1 total orders in the table (O004).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 19:49:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Know-how-many-users-news-repeat-an-order/m-p/3494707#M133868</guid>
      <dc:creator>EylesIT</dc:creator>
      <dc:date>2023-10-24T19:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Know how many users news repeat an order</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Know-how-many-users-news-repeat-an-order/m-p/3499196#M134142</link>
      <description>&lt;P&gt;That works perfectly! Many thanks for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 14:24:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Know-how-many-users-news-repeat-an-order/m-p/3499196#M134142</guid>
      <dc:creator>ATO23</dc:creator>
      <dc:date>2023-10-26T14:24:25Z</dc:date>
    </item>
  </channel>
</rss>

