Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Last sales date, if no purchases in n days [Measure Help]

Hi,

 

I'm trying to create a measure that will return a customers last sales date, if no sales were made in a periode of 180 days after that date, and only return the first time this happens for a customer.

 

I was thinking I could use CALCULATE to find the min[SalesDate] and then filter by checking if the Revenue from that date and 180 days forward was equal to 0, but it doesn't seem to be working.

 

Any suggestions how to alternate the measure to get my desired result?

 

Last SalesDate Before Lost = 
CALCULATE( MIN(Salg[SalesDate]);
					FILTER(VALUES(Salg[CustomerKey]);
						(
							CALCULATE(Salg[Revenue];
								DATESBETWEEN(Period[Date];
									LASTDATE(Period[Date]);
									DATEADD(LASTDATE(Period[Date]);+'Customer Churn'[Churn Days];DAY)
								)
							) = 0
						)
					)
)
1 REPLY 1
anupampandey
Helper III
Helper III

Hi,

 

I thing if you take the max transaction date of customer and take out the difference between current date and max date. If it is greater than 180 days flag them "True" else "False".

 

Thanks, 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.