Forum Discussion

atifakram's avatar
atifakram
Frequent Visitor
3 years ago

Sum of Distinct Count

I have sales data that is organized by weeks, but unfortunately, these weeks do not align with the calendar weeks. Each week, a specific set of customers are scheduled to be visited and invoiced in six different locations. The customers who are invoiced are considered productive, and unique customer codes are divided by the cumulative scheduled customers to determine the productive percentage. Depending on the criteria, a journey plan may consist of four or five weeks.

 

Once the plan enters its second week, I need to plot the sum of the distinct count of customer codes for each week. However, this is not happening, and I am unsure of what I am missing. I have utilized the below measures.

 

Customers Tapped = DISTINCTCOUNT(Sales[Customer Code])

 

Customers Scheduled = SUM(PJP[PJP])

 

Productive (%) = DIVIDE([Customers Tapped], [Customers Scheduled])

 

If I use the measure Customers Tapped, I would get 7,516 as an answer. As a way around this, I created another measure (see below), but the result is still the same.

 

Sum of Distinct Counts =
SUMX(
VALUES(Sales[JC]),
CALCULATE( DISTINCTCOUNT(Sales[Customer Code]) )
)

 

The actual answer is 12,376.

 

I am seeking assistance in identifying what I may be missing in my calculations.

 

 

3 Replies