Forum Discussion
Eliminate the overlapping data
- 6 years ago
Try this:
Existing Clients = var _existing = CALCULATETABLE(DISTINCT('Client List'[Client]), 'Client List'[Client Type (Calculated Column)] = "Existing Client") var _new = CALCULATETABLE(DISTINCT('Client List'[Client]), 'Client List'[Client Type (Calculated Column)] = "New Client") return COUNTROWS(EXCEPT(_existing, _new)) New Clients = CALCULATE( DISTINCTCOUNT('Client List'[Client]), 'Client List'[Client Type (Calculated Column)] = "New Client" )Bless you!
Vivek
Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter
Hi vivran22, thank you so much, this really solved the problem, but when the new client only appears once in a month, the _existing will still minus _new when it not supposed to minus it.
For example:
| Date | Client | Client Type (Calculated Column) |
| 1/1/2020 | A | New Client |
| 2/1/2020 | B | New Client |
| 1/2/2020 | A | Existing Client |
| 4/2/2020 | C | New Client |
| 5/2/2020 | C | Existing Client |
| 1/3/2020 | D | New Client |
| 2/3/2020 | A | Existing Client |
| 3/3/2020 | C | Existing Client |
With the measure, you provided it will show
Number of new clients in March = 1
Number of existing clients in March = 1 (it supposed to be 2 but with the _check equation, it will minus the number of new clients)
Is there any way that I could compare the [client with the condition of client type = new] and [client with the condition of client type = existing]?
Thanks,
Anonymous is it safe to assume that the date of New Client will always be less than Existing client for the same client ID?
Cheers!
Vivek
Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter
- Anonymous6 years agoNot applicable
vivran22 yes, the date of new client is always less than the existing client
- vivran226 years agoCommunity Champion
Try this:
Existing Clients = var _existing = CALCULATETABLE(DISTINCT('Client List'[Client]), 'Client List'[Client Type (Calculated Column)] = "Existing Client") var _new = CALCULATETABLE(DISTINCT('Client List'[Client]), 'Client List'[Client Type (Calculated Column)] = "New Client") return COUNTROWS(EXCEPT(_existing, _new)) New Clients = CALCULATE( DISTINCTCOUNT('Client List'[Client]), 'Client List'[Client Type (Calculated Column)] = "New Client" )Bless you!
Vivek
Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter