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
alya1
Helper V
Helper V

Customer Number and Turnover from 1 table (customer actions)

Hello, 

I tried to simplifiy the background by using just 1 table below: 

customers actions    
customer idaction subscription tier date reason 
111activateda1/1/2021sale
222activateda4/1/2021sale
333activateda4/1/2021sale
444activatedb4/22/2021  friend
111deactivated   c4/28/2021price
555activateda5/1/2021friend
...    
111reactivatedb9/30/2023sale
...    

There are many more rows and some customers reactivate/deactivate up to 5 times. 

 

1) Is there a way to easily calcuate the customer number and turnover by year/month/day? 

 

2) I tried to look up some staff turnover guides but their data table utilitzes columns ID, start date, end date. If anyone know how I can turn the above table to below, I would greately appreciate it!

IDStart DateEnd Date
1111/1/20214/28/2021
2224/1/2021 
3334/1/2021 
4444/22/2021 
5555/1/2021 
111 (re)   9/30/2023 

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@alya1 

not sure about the first question, what's the expected output based on the sample data you provide?

 

for the second one, you can create a column

end date = if('Table'[action ]="activated",minx(FILTER('Table','Table'[customer id]=EARLIER('Table'[customer id])&&'Table'[date ]>EARLIER('Table'[date ])),'Table'[date ]))
11.PNG
 
then you can create a visual and only select activate and reactivate data.
12.PNG
 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@alya1 

not sure about the first question, what's the expected output based on the sample data you provide?

 

for the second one, you can create a column

end date = if('Table'[action ]="activated",minx(FILTER('Table','Table'[customer id]=EARLIER('Table'[customer id])&&'Table'[date ]>EARLIER('Table'[date ])),'Table'[date ]))
11.PNG
 
then you can create a visual and only select activate and reactivate data.
12.PNG
 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you for your solution, it works! 

It appears my raw data have many missing values/issues so I will try to go about this another way for customer number and turnover. I am mainly trying to make my cleaned up table look like this: https://blog.enterprisedna.co/staff-turnover-calculation-in-power-bi-using-dax-hr-insights/

you are welcome. If you want to get the solution for another question. It's better to update the sample data and provide the expected output based on it.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.