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
Anonymous , I am assuming the date format is dd/mm/yyyy
Try measures like
distinctcount(table[Client])
calculate(distinctcount(table[Client]),[Client Type] ="New Client")
calculate(distinctcount(table[Client]),[Client Type] ="Existing Client")
Hi amitchandak , thanks for your reply but what I want to show is
Number of new clients in February: 1 (Client C)
Number of existing clients in February: 1 (only Client A, no matter how many times client C appears in February is still considered as a new client)
Much appreciated.
- vivran226 years agoCommunity Champion
Hello Anonymous
You may try the following measures:
New Client = CALCULATE ( DISTINCTCOUNT ( 'Client List'[Client] ), 'Client List'[Client Type (Calculated Column)] = "New Client" ) Existing Client = VAR _Summerize = SUMMARIZE ( 'Client List', 'Client List'[Client], 'Client List'[Client Type (Calculated Column)] ) VAR _Existing = SUMX ( FILTER ( _Summerize, 'Client List'[Client Type (Calculated Column)] = "Existing Client" ), 1 ) VAR _New = SUMX ( FILTER ( _Summerize, 'Client List'[Client Type (Calculated Column)] = "New Client" ), 1 ) VAR _Check = IF ( _New < _Existing , _Existing - _New, _New- _Existing ) RETURN _CheckOutput:
Cheers!
Vivek
Blog: vivran.in/my-blog
Connect on LinkedIn
Follow on Twitter- Anonymous6 years agoNot applicable
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,
- vivran226 years agoCommunity Champion
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