Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
ZakariAK
Regular Visitor

Count doesn't add up to the real total

Hi!

 

Im trying to make different distinctcounts with measures based on the same column and its 3 values, im trying to count the rows by an ID column, and made a count for each one of the values and also one for blank rows. The thing is, when adding up all these counts it doesnt coincide with the total count, here i give you de different measures:

Real Total = DISTINCTCOUNT('CRM'[Id Cliente])
 
En Seguimiento =
CALCULATE(
    DISTINCTCOUNT(CRM[Id Cliente]),
    CRM[Resultado] = "Seguimiento")
 ______
Ilocalizado =
CALCULATE(
    DISTINCTCOUNT(CRM[Id Cliente]),
    CRM[Resultado] = "Ilocalizado"
)
 _________
Cerrado =
CALCULATE(
    DISTINCTCOUNT(CRM[Id Cliente]),
    CRM[Resultado] = "Cierre"
)
 _________
Blanco =
CALCULATE(
    DISTINCTCOUNT(CRM[Id Cliente]),
    ISBLANK(CRM[Resultado])
)
 
dsadasdasdas.PNG

when adding upp the four measures, the total is +10 than the total count, anybody has a clue of why this is happening?

 

Thanks in advance

5 REPLIES 5
FreemanZ
Super User
Super User

hi @ZakariAK ,

 

distinct coiunt not adding up correctly is normal, supposing you have a table like:
 
Region Product
East A
East B
West A
 
distinct count of product for east region is 2 (A and B);
distinct count of product for west region is 1 (A);
they add up to 3, 
 
BUT, if we distinct count the product directly, we only get 2 (A and B).
 
Is that so?
 

What would be a correct way of counting the values without counting ID duplicates then?

This is a sample of the data: 

fdsfdsfdsf.PNG

 

 

hi @ZakariAK ,

 

first of all, that is not advisible. if you insist, with data table in my previous post,  try like:

measure = 
SUMX(
    VALUES(data[region]),
    CALCULATE(DISTINCTCOUNT(data[product]))
)

 

it worked like:

FreemanZ_0-1701181515854.png

 

Hi FreemanZ,

 

Could you please extrapolate it to the sample I gave you? Thanks in advance

try like:

measure = 
SUMX(
    VALUES(data[result]),
 CALCULATE(DISTINCTCOUNT(data[id client]))
)

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.