<?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: Lost Customer DaX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customer-DaX/m-p/3150461#M112833</link>
    <description>&lt;P&gt;This new measure did not seem to work in a graph . Not sure why ? In the table I can see the figures against the calender.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Mar 2023 15:48:01 GMT</pubDate>
    <dc:creator>JimmyKhan2022</dc:creator>
    <dc:date>2023-03-23T15:48:01Z</dc:date>
    <item>
      <title>Lost Customer DaX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customer-DaX/m-p/3148174#M112706</link>
      <description>&lt;P&gt;I have a measure that creates a FLAG to indicate whether customer is lost based on a set criteria. I am trying to get a customer count now and it does not appear to be working out correctly, gives me blank() .&amp;nbsp; If I place this Flag next to a customer in a table then it works, the flag is 1 against the right customers, but I cannot seem to get a count out currently I can use in a trend graph .....&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LOST CUSTOMER FLAG

_A_CURRENT MONTH_LOST CUST FLAG _NEW = 

// SELECTED FINANCIAL YEAR MONTH KEY
var _selected_Fin_Month = MAX('Time'[YearMonthKey])

// FIND LATEST RECORD in FINANCIAL YEAR WHERE REVENUE IS GREATER THAN ZERO
var _last_revenue_date = CALCULATE(MAX('General Ledger'[account_date]), REMOVEFILTERS ( 'Time' ) ,'General Ledger'[usd_revenue]&amp;gt;0
, 'Time'[YearMonthKey]&amp;lt;=_selected_Fin_Month  // Making sure no revenue records after Date selected on PAGE ! 
    )

// MONTH YEAR KEY GRAB
var _month_last_revenue=IF ( _last_revenue_date=blank() , 24241, LOOKUPVALUE('Time'[YearMonthKey], 'Time'[Date], _last_revenue_date) )

// MONTH YEAR KEY GRAB - 24 months in future from Revenue Record start 
var _month_last_revenue_24=_month_last_revenue +24 

// FINANCIAL YEAR KEY GRAB
var _year_last_revenue=LOOKUPVALUE('Time'[financial_year], 'Time'[YearMonthKey], _month_last_revenue_24)

// FINANCIAL MONTH KEY GRAB
var _fin_month_last_revenue=LOOKUPVALUE('Time'[YearMonthKey], 'Time'[YearMonthKey], _month_last_revenue_24)

// CHECK NEXT 24 CONSECUTIVE MONTHS TO SEE IF THERE IS ANY REVENUE ( LOOKING FOR NO REVENUE ! )
var _Future_24M_Revenue = CALCULATE(SUM('General Ledger'[usd_revenue]),
                        ALL('Time'),
                        'Time'[YearMonthKey] &amp;gt; _month_last_revenue 
						&amp;amp;&amp;amp; 'Time'[YearMonthKey] &amp;lt;= _month_last_revenue_24
						
						)
// SELECTED FINANCIAL YEAR 
var _selected_Fin_Year = MAX('Time'[financial_year])


//GENERATE A LOST CUST FLAG ?
var _Lost_FLAG=
IF ( (_Future_24M_Revenue=0  || _Future_24M_Revenue = BLANK()) &amp;amp;&amp;amp; _selected_Fin_Year=_year_last_revenue &amp;amp;&amp;amp; _selected_Fin_Month =_fin_month_last_revenue, 1 , 0 )


return 
_Lost_FLAG&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LATEST ATTEMPT

Customer count = CALCULATE(
    DISTINCTCOUNT('General Ledger'[customer_id])
    , FILTER('Key Measures',[_A_CURRENT MONTH_LOST CUST FLAG _NEW] = 1)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 20:29:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customer-DaX/m-p/3148174#M112706</guid>
      <dc:creator>JimmyKhan2022</dc:creator>
      <dc:date>2023-03-22T20:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Customer DaX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customer-DaX/m-p/3148588#M112726</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="501368" data-lia-user-login="JimmyKhan2022" class="lia-mention lia-mention-user"&gt;JimmyKhan2022&lt;/a&gt; , Please try like, Assuming ,[_A_CURRENT MONTH_LOST CUST FLAG _NEW] is a measure &lt;/P&gt;
&lt;P&gt;countx(filter(Values('General Ledger'[customer_id]) ,[_A_CURRENT MONTH_LOST CUST FLAG _NEW] = 1),[customer_id])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or refer to my way&lt;/P&gt;
&lt;P&gt;Customer Retention Part 1:&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/ba-p/1361529" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/ba-p/1361529&lt;/A&gt;&lt;BR /&gt;Customer Retention Part 2: Period over Period Retention :&lt;A href="https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retention/ba-p/1377458" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retention/ba-p/1377458&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: &lt;A href="https://youtu.be/EyL7KMw877Q" target="_blank"&gt;https://youtu.be/EyL7KMw877Q&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 01:45:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customer-DaX/m-p/3148588#M112726</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2023-03-23T01:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Lost Customer DaX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customer-DaX/m-p/3150461#M112833</link>
      <description>&lt;P&gt;This new measure did not seem to work in a graph . Not sure why ? In the table I can see the figures against the calender.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:48:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lost-Customer-DaX/m-p/3150461#M112833</guid>
      <dc:creator>JimmyKhan2022</dc:creator>
      <dc:date>2023-03-23T15:48:01Z</dc:date>
    </item>
  </channel>
</rss>

