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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Customer Retention Calculation

Hi 

I have a table where  I have custmer transactions,

TRX DateTransaction YearShowEvent Name UniqueEvent NameShow YearFirst Year SaleOriginating Master IDOriginating Master Name Total Amount 

 

TX DateTX YearProjectDepartmentProject YearCustomer IDCustomer Name
9/06/20102010DB10DB2010CIE003CIE
14/02/20142014AOG14AOG2014ENG007Energy
3/05/20112011FF11FF2011MIN033Ministry of Commerce 
20/01/20152015AOG15AOG2015134565 Gmbh
20/12/20102010AOG11AOG2011IES003IES 
19/09/20112011AOG12AOG2012DEP027Department of Economic Development
4/12/20092009FF10FF2010EMB012Embas

 

same customer can have transaction with different departments and  projects. Whats the best way to calculate customer retention (by  department)

thank you

1 REPLY 1
artemus
Microsoft Employee
Microsoft Employee

Do a group by on departement and customer ID as the key fields. In the aggregation, choose Max on TX Date . This will give you a table of when a customer did their most recent transaction. You can then add a column with a calcuation determing if the transaction is recent enough to count as being retained or not e.g.

if Date.IsInCurrentMonth([TX Date]) or Date.IsInPreviousNMonths([TX Date], 3) then 1 else 0

. After that you can do another group by on just departmenet, this time summing your new column up, and another aggregate to count rows. This will give you a customers retained and total customers. Finally you can divide. the two columns to find the percentage.

 

Note this will include all customers even if they have had no transactions in a very long time. If you want to exclude these. Do a filter on the TX Date to remove all old entries (as your first step)

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors