Forum Discussion

Roseventura's avatar
Roseventura
Responsive Resident
6 years ago
Solved

DISTINCTCOUNT Total not correct

I know this issue has been raised ad nauseam, and I have tried many different approaches including ISFILTERED, HASONEFILTER, HASONEVALUE, and SUMMARIZE.  I still cannot get my table to give me a total of Distinct Customers.

 

The TABLE[Field] I'm using to count the customer names is the PBI_Disti_NICPoscy[ENDCUS]I need my visual table (below) to show me how many distinct customers had orders for each month and then of course the grand total at the bottom.  My problem is that the grand total is incorrect.

 

Here is the measure I am currently using:

 

Total POS Customers =
Var DISTINCTCUSTOMERS = summarize(PBI_Disti_NICPoscy,PBI_Disti_NICPoscy[ENDCUS],"DistCust",DISTINCTCOUNT(PBI_Disti_NICPoscy[ENDCUS]) )
RETURN
SUMX(DISTINCTCUSTOMERS,[DistCust])

 

The total at the bottom represent ALL the distinct customers, which in my summary table is 8,771.  I've tried so many different things, but I still keep getting 8771.  The correct total should be 12,660.

 

At me wits end!

 

 

 

 

 

 

 

4 Replies

  • ImkeF's avatar
    ImkeF
    Community Champion

    Hi Roseventura 

    How about: SUMX ( VALUES ( DimCalendar[Year-Mo] ), DISTINCTCOUNT(PBI_Disti_NICPoscy[ENDCUS]) ) ?

     

    (Replace name of your calendar-table)