Forum Discussion
returning customer count
- 7 years ago
This is really confusing.
I've made my own example dataset:
The calculated column "Column" is simply:Column = VAR ID_ = [did_groups] VAR DATE_ = [ltime] return IF(CALCULATE( SUM([lon]); ALL(Table1); Table1[did_groups] = ID_; table1[ltime] < DATE_ ) >0 ;1;0)
Which gives me 7.
Then i use the measure:Measure = Calculate(distinctcount([did_groups]);Table1[Column]=1)
Which removes 1 and give's me 6. Which should be the correct number of returning customers in the dataset that I made.
:->
The resultcolumn is wrong - e.g. DID 2, Group "Mc Donalds" is not a returning customer, since he was there on the same day. DID 3 has 3 times the flag 1, but it should count as 1 returning customer, because it does not matter how often he was there. It only matters that he was there on >1 different days. Then this did counts as ONE returning customer overall. No matter if he was there on 10 or 50 different days.
This is really confusing.
I've made my own example dataset:
The calculated column "Column" is simply:
Column = VAR ID_ = [did_groups] VAR DATE_ = [ltime] return IF(CALCULATE( SUM([lon]); ALL(Table1); Table1[did_groups] = ID_; table1[ltime] < DATE_ ) >0 ;1;0)
Which gives me 7.
Then i use the measure:
Measure = Calculate(distinctcount([did_groups]);Table1[Column]=1)
Which removes 1 and give's me 6. Which should be the correct number of returning customers in the dataset that I made.
:->
- Anonymous7 years agoNot applicable
I appreciate your help. Im going to validate it with my data. Unfortunately I don't have time at the moment, but will mark your answer as the solution since it seems to work with your example and will take a deeper look when I've got time :)
- tex6287 years agoCommunity Champion
Just give me shout if it doesn't resolve itself! :-)