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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Richard77
Resolver I
Resolver I

New and exit clients over multiple years

Hi all,

I am looking for help on a solution that I cannot seem to wrap my head around.

 

We have a table that has rows for clients (includes a client_id) for each year that they are involved in projects over the period 2020 until 2025. The clients that had a project in 2020 are 'baseline', let's say that there are 100. Then in 2021 new clients join (e.g. 20), some will leave (e.g. 5) and some will stay and this repeats itself until 2025. In 2020 my total is 100 and in 2021 the delta is 15. Now I'd like to have a visualisation that shows per year the number of new clients and the number of clients that left (so I leave out the clients that continue, only the specific delta matters).

 

How can I solve this in Power BI?

 

Thank you already for thinking with me!!

 

Cheers, 

Richard

3 REPLIES 3
Richard77
Resolver I
Resolver I

Thank you both for your answers! I will have a look at them both but I might need a while to fully understand it 😉

Anonymous
Not applicable

Try following 

  1. Create a new column called "Baseline" and set it to "Yes" for all rows that have a year of 2020 and "No" for all other years.

  2. Create a new column called "Delta" and set it to 1 for all new clients that appear in a year and -1 for all clients that leave in a year. Set it to 0 for all other rows.

  3. Create a new table that groups the data by year and calculates the sum of the "Delta" column for each year. This will give you the number of new clients and the number of clients that left for each year.

  4. Use a visualization chart .
ELofstrom3C
Frequent Visitor

Richard - 
Check out this pattern from the folks over at SQLBI.com.  Perhaps this will meet your needs?
New and returning customers – DAX Patterns

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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