<?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: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1258951#M20875</link>
    <description>&lt;P&gt;HI&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See if this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=GK-W25RM87Q" target="_blank"&gt;https://www.youtube.com/watch?v=GK-W25RM87Q&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regrads,&lt;/P&gt;&lt;P&gt;Harsh Nathani&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jul 2020 10:47:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-07-29T10:47:08Z</dc:date>
    <item>
      <title>Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1258781#M20865</link>
      <description>&lt;P&gt;Hi Community&lt;/P&gt;&lt;P&gt;This one has baffled me for a while now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to come up with the right method and DAX for calculating the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;New Business - Total Sales Amount on an Item &amp;amp; Customer combination that sells for the first time in a rolling 12 month period.&lt;/LI&gt;&lt;LI&gt;Returning Business - Total Sales Amount in 24 months on Item &amp;amp; Customer combination that has ordered in the previous 12 months and has prior 12 months.&lt;/LI&gt;&lt;LI&gt;Lost Business - Total Sales Amount for Item and Customer comination that hasn't ordered in 12 months but has in prior 12 months.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I have a date table at the ready, and all of my Sales Data is in one table. So the model is very simple. I'm using SSAS Tabular Live Connection, so any changes would be back end.&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any other posts I've found online are looking at number of customers, and aren't specific to 'Item and Customer' combination.&lt;/P&gt;&lt;P&gt;Appreciate your help.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 09:33:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1258781#M20865</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-29T09:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1258938#M20872</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , refer if this can help&lt;/P&gt;
&lt;P&gt;new vs repeat customer &lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Churn-Rate-lost-Customer/m-p/1173754#M529196" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/Churn-Rate-lost-Customer/m-p/1173754#M529196&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://blog.enterprisedna.co/new-vs-existing-customers-advanced-analytics-w-dax/" target="_blank"&gt;https://blog.enterprisedna.co/new-vs-existing-customers-advanced-analytics-w-dax/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/computing-new-customers-in-dax/" target="_blank"&gt;https://www.sqlbi.com/articles/computing-new-customers-in-dax/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 10:43:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1258938#M20872</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-07-29T10:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1258946#M20874</link>
      <description>&lt;P&gt;Thank you, but these are the posts I was refering to as not specific to Customer+Item, and using Sales Amount with the logic I've mentioned above.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 10:46:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1258946#M20874</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-29T10:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1258951#M20875</link>
      <description>&lt;P&gt;HI&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See if this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=GK-W25RM87Q" target="_blank"&gt;https://www.youtube.com/watch?v=GK-W25RM87Q&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regrads,&lt;/P&gt;&lt;P&gt;Harsh Nathani&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 10:47:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1258951#M20875</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-29T10:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1258958#M20876</link>
      <description>&lt;P&gt;Hi, thanks, yes this is also something I've already looked at and what I'm really looking for is Sales value for item+customer combination.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 10:49:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1258958#M20876</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-29T10:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1259461#M20904</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// Assumptions:
// 1. Dates table marked as the Data table in the model.
// 2. Sales as the fact table.
// 3. Customers as a dimension.
// 4. Products as a dimension.
// You should always, without exceptions, create correct
// dimensional models. Only then will you be sure that
// your measures work correctly in all circumstances.
// You don't aim at a model that stores everything in one
// table. Rather, you aim at a proper dimensional design.

// 1) New Business - Total sales for unique visible combinations
// 	  (CustomerId, ProductId) such that the product sells for
//    the first time in a rolling 12-month period, meaning the
//    combination is not present in the past beyond the period,
//    whatever the past contains (might be empty).
// 2) Returning Business - Total sales in 24 months for unique
//    combinations (CustomerId, ProductId) that are present
//    also in the 12-month period preceding the 24 months.
//    The 12-month period must be present in the calendar in full.
// 3) Lost Business - Total sales for the unique visible combinations
//    (CustomerId, ProductId) which are not present in the past 12
//    months but are present in the prior 12 months. The prior 12 months
//    must be present in the calendar.
//
// Let's assume that there is a measure that returns the total sales
// for any slicing:

[Total Sales] = SUM( Sales[Amount] )

// Based on the above:

[New Business] =
var __lastVisibleDate = MAX( Dates[Date] )
var __rolling12Months =
	DATESINPERIOD(
		Dates[Date],
		__lastVisibleDate,
		-12,
		MONTH
	)
var __shouldCalculate = 
	// We have to make sure that the rolling
	// period does indeed have 12 months,
	// not fewer. It might not be 12 months
	// if we are too close to the left end of
	// the calendar.
	CALCULATE(
		DISTINCTCOUNT( Dates[MonthID] ) = 12,
		__rolling12Months
	)
var __result = 
	if( __shouldCalculate,
		
		var __periodPriorTo12Months =
			EXCEPT(
				FILTER(
					ALL( Dates[Date] ),
					Dates[Date] &amp;lt;= __lastVisibleDate
				),
				__rolling12Months
			)
		var __customerProductIn12Months =
			CALCULATETABLE(
				SUMMARIZE(
					Sales,
					Customers[CustomerID],
					Products[ProductID]
				),
				__rolling12Months
			)
		var __customerProductPriorTo12Months =
			CALCULATETABLE(
				SUMMARIZE(
					Sales,
					Customers[CustomerID],
					Products[ProductID]
				),
				__periodPriorTo12Months
			)
		var __effectiveCustomerProduct =
			EXCEPT(
				__combinationsIn12Months,
				__combinationsPriorTo12Months
			)
		return
			// You have to decide what you want
			// to calculate here for the set
			// of pairs (CustomerId, ProductId).
			// Especially, what period of time
			// you want... I assume you want
			// the 12-month rolling period.
			CALCULATE(
				[Total Sales],
				__effectiveCustomerProduct,
				__rolling12Months,
				ALL( Customers ),
				AlL( Products ),
				ALL( Dates )
			)
	)
return
	__result
	
// I'll post the other measures when I get
// a chance to write them... Stay tuned!&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 14:13:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1259461#M20904</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-29T14:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1259486#M20908</link>
      <description>&lt;P&gt;WOW! I'm blown away by this. It worked!&amp;nbsp;&lt;/P&gt;&lt;P&gt;A few changes to&amp;nbsp; __customerProductIn12Months,&lt;BR /&gt;__customerProductPriorTo12Months and linking to my dim customer and dim products table and we're good!&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;Can't wait for the rest.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 14:22:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1259486#M20908</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-29T14:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1259500#M20909</link>
      <description>&lt;P&gt;Of course, this condition&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var __shouldCalculate = 
	// We have to make sure that the rolling
	// period does indeed have 12 months,
	// not fewer. It might not be 12 months
	// if we are too close to the left end of
	// the calendar.
	CALCULATE(
		DISTINCTCOUNT( Dates[MonthID] ) = 12,
		__rolling12Months
	)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;works correctly only for the days that are the ends of months. The beginning of the code should be changed to this&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;[New Business] =
var __lastVisibleDate = LASTDATE( Dates[Date] ) // LINE CHANGED
var __rolling12Months =
	DATESINPERIOD(
		Dates[Date],
		__lastVisibleDate,
		-12,
		MONTH
	)
var __shouldCalculate = 
	// We have to make sure that the rolling
	// period does indeed have 12 months,
	// not fewer. It might not be 12 months
	// if we are too close to the left end of
	// the calendar.
	MAX(
		NEXTDAY( DATEADD( Dates[Date], -1, YEAR ) ),
		DATEADD( NEXTDAY( Dates[Date] ), -1, YEAR ))
	) &amp;lt;&amp;gt; BLANK()
	
var __result = ... // same stuff as above
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 14:32:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1259500#M20909</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-29T14:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1259567#M20919</link>
      <description>&lt;LI-CODE lang="csharp"&gt;[Returning Business] =
var __lastVisibleDate = LASTDATE( Dates[Date] )
var __rolling24Months =
	DATESINPERIOD(
		Dates[Date],
		__lastVisibleDate,
		-24,
		MONTH
	)
var __shouldCalculate = 
	// We have to make sure that the rolling
	// period does indeed have 24 + 12 months,
	// not fewer.
	MAX(
		NEXTDAY( DATEADD( Dates[Date], -(24 + 12), MONTH ) ),
		DATEADD( NEXTDAY( Dates[Date] ), -(24 + 12), MONTH ))
	) &amp;gt; BLANK()
	
var __result =
	if( __shouldCalculate,
		
		var __periodPriorTo24Months =
			EXCEPT(
				DATESINPERIOD(
					Dates[Date],
					__lastVisibleDate,
					-(24 + 12),
					MONTH
				)
				__rolling24Months
			)
		var __customerProductIn24Months =
			CALCULATETABLE(
				SUMMARIZE(
					Sales,
					Customers[CustomerID],
					Products[ProductID]
				),
				__rolling24Months
			)
		var __customerProductPriorTo24Months =
			CALCULATETABLE(
				SUMMARIZE(
					Sales,
					Customers[CustomerID],
					Products[ProductID]
				),
				__periodPriorTo24Months
			)
		var __effectiveCustomerProduct =
			INTERSECT(
				__customerProductIn24Months,
				__customerProductPriorTo24Months
			)
		return
			CALCULATE(
				[Total Sales],
				__effectiveCustomerProduct,
				__rolling24Months,
				ALL( Customers ),
				AlL( Products ),
				ALL( Dates )
			)
	)
return
	__result&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 29 Jul 2020 15:03:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1259567#M20919</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-29T15:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1259584#M20923</link>
      <description>&lt;LI-CODE lang="csharp"&gt;// 3) Lost Business - Total sales for the unique visible combinations
//    (CustomerId, ProductId) which are not present in the past 12
//    months but are present in the prior 12 months. The prior 12 months
//    must be present in the calendar.

[Lost Business] =
var __lastVisibleDate = LASTDATE( Dates[Date] )
var __rolling12Months =
	DATESINPERIOD(
		Dates[Date],
		__lastVisibleDate,
		-(12),
		MONTH
	)
var __shouldCalculate = 
	// We have to make sure that the rolling
	// period does indeed have 24 + 12 months,
	// not fewer.
	MAX(
		NEXTDAY( DATEADD( Dates[Date], -(12 + 12), MONTH ) ),
		DATEADD( NEXTDAY( Dates[Date] ), -(12 + 12), MONTH ))
	) &amp;gt; BLANK()
	
var __result =
	if( __shouldCalculate,
		
		var __periodPriorTo12Months =
			EXCEPT(
				DATESINPERIOD(
					Dates[Date],
					__lastVisibleDate,
					-(12 + 12),
					MONTH
				)
				__rolling12Months
			)
		var __customerProductIn12Months =
			CALCULATETABLE(
				SUMMARIZE(
					Sales,
					Customers[CustomerID],
					Products[ProductID]
				),
				__rolling12Months
			)
		var __customerProductPriorTo12Months =
			CALCULATETABLE(
				SUMMARIZE(
					Sales,
					Customers[CustomerID],
					Products[ProductID]
				),
				__periodPriorTo12Months
			)
		var __effectiveCustomerProduct =
			EXCEPT(
				__customerProductPriorTo12Months,
				__customerProductIn12Months
			)
		return
			CALCULATE(
				[Total Sales],
				__effectiveCustomerProduct,
				// If we filter by the last 12 months,
				// we'll obviously get BLANK as these
				// combinations do not exist in the
				// last 12 months. We then need to use
				// the 12-month period before the rolling
				// one.
				__periodPriorTo12Months,
				ALL( Customers ),
				AlL( Products ),
				ALL( Dates )
			)
	)
return
	__result&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 29 Jul 2020 15:19:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1259584#M20923</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-29T15:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1261892#M21023</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is why I'm thankful to the PBI community here. Thank you so much.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just one thing: I've implemented the measures and with a few tweaks, works perfectly. Except one thing I overlooked.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Returning Business was wrong in my original spec. I was imagining that I'd require 24 months in my measure but I actually just need 12 months. It's the lost business that would need to look in the 12-24 month period to work out the sum of sales lost.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I adapt the measure for Returning Business to a 12 month period?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Shouldcalculate variable confuses me slightly,&amp;nbsp;var __shouldCalculate =&lt;BR /&gt;MAX(&lt;BR /&gt;NEXTDAY( DATEADD( 'Primary Date Table'[Date], -(24 + 12), MONTH ) ),&lt;BR /&gt;DATEADD( NEXTDAY( 'Primary Date Table'[Date]), -(24 + 12), MONTH ))&lt;BR /&gt;&amp;gt; BLANK()&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Why would I need to add 24 + 12? Would I need to in this case?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jul 2020 12:37:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1261892#M21023</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-30T12:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1262536#M21061</link>
      <description>24 + 12 is based on your spec. You need to be able to go back in time 24 months and then 12 more. This means that the first day of the period after this operation has been performed must exist in the calendar. This is why you need this condition. If such a day is not present in the calendar, the output of the MAX(…) operation will be BLANK. To know why you need max( nextday(dateadd), dateadd(nextday) ) you have to study the way the functions work and consider the boundary conditions, that is, when the calendar has just 1 year in it, or just 2 years, or just 3...&lt;BR /&gt;&lt;BR /&gt;I hope this clarifies everything.</description>
      <pubDate>Thu, 30 Jul 2020 15:08:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1262536#M21061</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-30T15:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1262683#M21072</link>
      <description>&lt;P&gt;Thanks for your response.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for the new definition:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Returning Business&lt;/STRONG&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Total Sales Amount in 12 months on Item &amp;amp; Customer combination that has ordered in the previous 12 months and has in the prior 12 months.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Returning Business:=
var __lastVisibleDate = LASTDATE( 'Primary Date Table'[Date] )
var __rolling12Months = //Changed from __rolling24Months
	DATESINPERIOD(
		'Primary Date Table'[Date],
		__lastVisibleDate,
		-12, //Changed from -24
			MONTH
	)
var __shouldCalculate = 
	MAX(
		NEXTDAY( DATEADD( 'Primary Date Table'[Date], -(24 + 12), MONTH ) ),
		DATEADD( NEXTDAY( 'Primary Date Table'[Date]), -(24 + 12), MONTH ))
	 &amp;gt; BLANK()
	
var __result =
	if( __shouldCalculate,
		
		var __periodPriorTo24Months =
			EXCEPT(
				DATESINPERIOD(
					'Primary Date Table'[Date],
					__lastVisibleDate,
					-(24 + 12),
					MONTH
				),
				__rolling24Months
)
		var __customerProductIn24Months =
			CALCULATETABLE(
				SUMMARIZE(
					'Sales Flash',
					Customer[CustomerID],
					'Item'[ItemID]
				),
				__rolling24Months
			)
		var __customerProductPriorTo24Months =
			CALCULATETABLE(
				SUMMARIZE(
					'Sales Flash',
					Customer[CustomerID],
					'Item'[ItemID]
				),
				__periodPriorTo24Months
			)
		var __effectiveCustomerProduct =
			INTERSECT(
				__customerProductIn24Months,
				__customerProductPriorTo24Months
			)
		return
			CALCULATE(
				[Total Sales (R)],
				__effectiveCustomerProduct,
				__rolling12Months,//Changed from __rolling24Months
				ALL( 'Customer' ),
				AlL( 'Item' ),
				ALL( 'Primary Date Table' )
			)
	)
return
	__result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jul 2020 15:41:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1262683#M21072</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-30T15:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1264258#M21133</link>
      <description>Nope. All 24's must be changed to 12's.</description>
      <pubDate>Fri, 31 Jul 2020 08:19:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1264258#M21133</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-31T08:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1318743#M23174</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your help here to identify new, returning and lost Item+Customer sales has been so powerful.&lt;/P&gt;&lt;P&gt;I've now been asked to help apply the same logic to just the customers, without including the item in the calcuation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So instead of New Customers+Item, Returning Customer+Item, or Lost Customer+Item, it'll be just customer counts with the same logic around the date periods.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to modify your code here but SUMMARIZE function springs an error on Argument 3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your help is very appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2020 08:48:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1318743#M23174</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-24T08:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1318838#M23178</link>
      <description>You just have to get rid of any references to 'Item' from the code.</description>
      <pubDate>Mon, 24 Aug 2020 09:19:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1318838#M23178</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-24T09:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1319103#M23183</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp; Thank you Daxer, this is where I get the Summarize error when removing the ItemNo.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2020 10:41:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1319103#M23183</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-24T10:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1319182#M23184</link>
      <description>&lt;P&gt;Are you saying that you get an error from:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;SUMMARIZE(
    'Sales Flash',
    Customer[CustomerID]
)&lt;/LI-CODE&gt;&lt;P&gt;If you do (but I seriously doubt it), then 'Sales Flash' is just not connected via *:1 to Customer.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2020 11:14:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1319182#M23184</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-24T11:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with 'New Business, 'Returning Business' and 'Lost Business' DAX Calculations</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1320128#M23210</link>
      <description>&lt;P&gt;You were right. I missed something. Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2020 17:06:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-New-Business-Returning-Business-and-Lost-Business-DAX/m-p/1320128#M23210</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-24T17:06:02Z</dc:date>
    </item>
  </channel>
</rss>

