Forum Discussion

dgdgdg122db's avatar
dgdgdg122db
Helper II
6 years ago
Solved

Countx returns unexpected result

Hi ,

I want to count No. of customers who occurred once and more than 1 once.

First I have a calculated column : 

Order occurrence = COUNTX(
FILTER('Unique Order customer',
EARLIER('Unique Order customer'[Customer No.])='Unique Order customer'[Customer No.]) ,
'Unique Order customer'[Customer No.])
 
For the occurrence =1, 
First Time Buyers = COUNTX(FILTER('Unique Order customer','Unique Order customer'[Order occurance]=1),'Unique Order customer'[Customer No.])
and this gives me the correct result.
 
However, when I switch to more than 1, the result is not what I want.
Returning Customers = COUNTX(FILTER('Unique Order customer','Unique Order customer'[Order occurance] >1),'Unique Order customer'[Customer No.])
 
as in the card visual, it shows 30, but it is actually only 8 customers 

2 Replies