<?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: How to Count New Client in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Count-New-Client/m-p/3530263#M135647</link>
    <description>&lt;P class=""&gt;&lt;SPAN class=""&gt;Hi, thanks for the great solution!! In the source table I also have the name of the agent who sells to that customer and I would like to see the new customers and lost customers per individual agent. Instead of the list, would it be possible to click on the year and view the new customers or lost customers in a table like the one I attach? Thank you 1000&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Nov 2023 07:42:49 GMT</pubDate>
    <dc:creator>Morrison</dc:creator>
    <dc:date>2023-11-13T07:42:49Z</dc:date>
    <item>
      <title>How to Count New Client</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Count-New-Client/m-p/3527562#M135543</link>
      <description>&lt;P class=""&gt;&lt;SPAN class=""&gt;Hi, from a sales table with &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;CustomerKey, Date, SalesNetAmount, &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;I would like to count the number of new customers, all those customers who in 2022 were not in 2021 and all those customers who in 2023 were neither in 2021 nor in 2022. At the same time I would like to see the number of customers lost, all those who no longer bought in 2022 compared to 2021 and who in 2023 no longer bought compared to 2022.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Please help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; !&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 11:12:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Count-New-Client/m-p/3527562#M135543</guid>
      <dc:creator>Morrison</dc:creator>
      <dc:date>2023-11-10T11:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to Count New Client</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Count-New-Client/m-p/3527702#M135549</link>
      <description>&lt;P&gt;plz share sample table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 12:38:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Count-New-Client/m-p/3527702#M135549</guid>
      <dc:creator>Rupak_bi</dc:creator>
      <dc:date>2023-11-10T12:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to Count New Client</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Count-New-Client/m-p/3527850#M135560</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 13:58:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Count-New-Client/m-p/3527850#M135560</guid>
      <dc:creator>Morrison</dc:creator>
      <dc:date>2023-11-10T13:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to Count New Client</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Count-New-Client/m-p/3527866#M135561</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="418380" data-lia-user-login="Morrison" class="lia-mention lia-mention-user"&gt;Morrison&lt;/a&gt;&amp;nb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&lt;/TD&gt;
&lt;TD&gt;1/1/2022&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;try to&lt;/P&gt;
&lt;P&gt;1) add a calculated column like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Year = YEAR([date])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) plot a table visual with the [Year] column and measures like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;NewCount = 
VAR _priorlist =
CALCULATETABLE(
    VALUES(data[CustomerKey]),  
    data[year]&amp;lt;MAX(data[year])
)
VAR _currentlist =VALUES(data[CustomerKey])
VAR _gaplist = EXCEPT(_currentlist, _priorlist)
VAR _result = COUNTROWS(_gaplist)
RETURN IF(ISEMPTY(_priorlist), 0, _result)+0&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;NewList = 
VAR _priorlist =
CALCULATETABLE(
    VALUES(data[CustomerKey]), 
    data[year]&amp;lt;MAX(data[year])
)
VAR _currentlist =VALUES(data[CustomerKey])
VAR _gaplist = EXCEPT(_currentlist, _priorlist)
VAR _result = CONCATENATEX(_gaplist, data[CustomerKey], ", ")
RETURN IF(ISEMPTY(_priorlist), "", _result)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;LostCount = 
VAR _prelist =
CALCULATETABLE(
    VALUES(data[CustomerKey]),  
    data[year]=MAX(data[year])-1
)
VAR _currentlist = VALUES(data[CustomerKey])
VAR _gaplist = EXCEPT(_prelist, _currentlist)
VAR _result = COUNTROWS(_gaplist)
RETURN IF(ISEMPTY(_prelist), 0, _result)+0&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;LostList = 
VAR _prelist =
CALCULATETABLE(
    VALUES(data[CustomerKey]),  
    data[year]=MAX(data[year])-1
)
VAR _currentlist =VALUES(data[CustomerKey])
VAR _gaplist = EXCEPT(_prelist, _currentlist)
VAR _result = CONCATENATEX(_gaplist, data[CustomerKey], ", ")
RETURN IF(ISEMPTY(_prelist), "", _result)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it worked like:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 14:12:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Count-New-Client/m-p/3527866#M135561</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-11-10T14:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to Count New Client</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Count-New-Client/m-p/3530263#M135647</link>
      <description>&lt;P class=""&gt;&lt;SPAN class=""&gt;Hi, thanks for the great solution!! In the source table I also have the name of the agent who sells to that customer and I would like to see the new customers and lost customers per individual agent. Instead of the list, would it be possible to click on the year and view the new customers or lost customers in a table like the one I attach? Thank you 1000&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2023 07:42:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Count-New-Client/m-p/3530263#M135647</guid>
      <dc:creator>Morrison</dc:creator>
      <dc:date>2023-11-13T07:42:49Z</dc:date>
    </item>
  </channel>
</rss>

