Forum Discussion
Count (Customerid) except certain confition
- 6 years ago
Hi uaydogdu
I would suggest something along these lines:
Customer Count AC but not DC = VAR AC_Customers = CALCULATETABLE ( DISTINCT ( YourTable[ID] ), YourTable[Status] = "AC" ) VAR DC_Customers = CALCULATETABLE ( DISTINCT ( YourTable[ID] ), YourTable[Status] = "DC" ) RETURN COUNTROWS ( EXCEPT ( AC_Customers, DC_Customers ) )This measure just takes the set difference between Customers with Status AC and Customers with Status DC, and counts the resulting Customers.
This should give the result you expect when filtered by Year (or any other time period).
Does this work for you?
Regards,
Owen
Hi uaydogdu
I would suggest something along these lines:
Customer Count AC but not DC =
VAR AC_Customers =
CALCULATETABLE ( DISTINCT ( YourTable[ID] ), YourTable[Status] = "AC" )
VAR DC_Customers =
CALCULATETABLE ( DISTINCT ( YourTable[ID] ), YourTable[Status] = "DC" )
RETURN
COUNTROWS ( EXCEPT ( AC_Customers, DC_Customers ) )This measure just takes the set difference between Customers with Status AC and Customers with Status DC, and counts the resulting Customers.
This should give the result you expect when filtered by Year (or any other time period).
Does this work for you?
Regards,
Owen
- uaydogdu6 years ago
Helper I
Dear Owen ,
I appreciate your answer. I got the way your appraoch, very good. I'll try to implement.
Regards