Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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
Solved! Go to Solution.
Hi @Anonymous,
Yes, the value of "Count (Distinct)" setting in the visual is equal to the measure with COUNT and DISTINCTCOUNT function.
Best Regards,
Cherry
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)...
Regards,
Will
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.
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
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.
Best Regards,
Cherry
User | Count |
---|---|
141 | |
113 | |
104 | |
78 | |
64 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |