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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.