Forum Discussion
Lost customer between two years
Hello everyone 
i've been asked to find a way to compare customers activity between two years.
I don't need to have the exact values of their purchases but i have to show if between one time interval to an another they have stopped working with us. ( From 2016 to 2017).
I'm a beginner with DAX language but i would like to find a way to exprim my request.
If you need more information about my request you can ask me futher details.
Best regards
Kurumy
9 Replies
- fhillResident Rockstar
How is your customer data formatted? Is is a list of Invoices with Dates and Customer ID's, or do you have something more Matrix based with annual sales?
FOrrest
- kurumyFrequent Visitor
In fact it is a table of the annual sales.
Each round represent a command and it is compose by differents columns which provide information like the customer name, dates, the product...
The thing is than i have already found a way to show the new customers from one year to another but i can't manage to show customers whose have been lost.
This is the formula i use of new customers.
new = COUNTROWS ( DISTINCT ( EXCEPT ( SELECTCOLUMNS ( Table1, "customerId", Table1[customerId] ), SELECTCOLUMNS ( FILTER ( ALL ( Table1 ), Table1[year] = MAX ( Table1[year] ) - 1 ), "customerId", Table1[customerId] ) ) ) ) - kurumyFrequent Visitor
In fact it is a table of the annual sales.
Each round represent a command and it is compose by differents columns which provide information like the customer name, dates, the product...
The thing is than i have already found a way to show the new customers from one year to another but i can't manage to show customers whose have been lost.
This is the formula i use of new customers.
new = COUNTROWS ( DISTINCT ( EXCEPT ( SELECTCOLUMNS ( Table1, "customerId", Table1[customerId] ), SELECTCOLUMNS ( FILTER ( ALL ( Table1 ), Table1[year] = MAX ( Table1[year] ) - 1 ), "customerId", Table1[customerId] ) ) ) )- v-huizhn-msftMicrosoft Employee
Hi kurumy,
Could you share some sample table for further analysis? So that we can post the specific formula which is corresponding your data. There are several articles that describe how to calculate the lost customers, please review.
New and Returning Customers
Lost Customers DAX Calculation for Power BI
Best Regards,
Angelia