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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Measure calculating difference between two distinct counts not giving correct answer

Hi there,

I have two columns in a table visualisation, which show the distinct counts of ID fields. I have also created a measure which should just show the difference between the distinct counts:


Difference = DISTINCTCOUNT(dat4[id]) - DISTINCTCOUNT(dat4[GIN.Number])

 

...but it isn't working. In the image below, you can see that the difference is correct for some entries and not for others. Anyone know why this might be?

 

Regards,

Will

 

Capture.PNG

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

Yes, the value of "Count (Distinct)" setting in the visual is equal to the measure with COUNT and DISTINCTCOUNT function.

 

Capture.PNG

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

On further investigation, it seems that the DISTINCTCOUNT function is giving a different count to using the 'Count (Distinct)' value setting in the table visualisation. Anyone know why this would be?

 

I added two measures of just the DISTINCTCOUNT(id variable) to the table visualisation, and as you can see, the counts are different (see 04/08/2018)...

 

 

Capture.JPG

 

Regards,

Will

Anonymous
Not applicable

I think it must be to do with blanks in one of the ID fields. I think that the visualisation Count (Distinct) setting must count (blank) as a distinct value, whereas the DISTINCTCOUNT function does not.

 

Will

Hi @Anonymous,

 

The fucntion COUNT and DISCOUNT are different. Here is a simple example, you may could see the difference from the image below.

 

Capture.PNG

You also could have a good look at the document about COUNT and DISTINCTCOUNT function.

 

If you still need help, please feel free to ask.

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Cherry, 

I was using the "Count (Distinct)" setting in the visual, so assumed it would return the same count as using DISTINCTCOUNT in DAX.

 

Regards,

Will

Hi @Anonymous,

 

Yes, the value of "Count (Distinct)" setting in the visual is equal to the measure with COUNT and DISTINCTCOUNT function.

 

Capture.PNG

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors