Forum Discussion
Power BI - Distinct Count not working
- Anonymous3 years ago
Hi PRFInstitute ,
When you place in the card visual object, the distinguish count counts the number of all non-repeating values in the u-id column only (i.e. un1-un6,un8-9, 8 in total), and when you add a classification of age to the pie chart, the distinguish count counts the number of all non-repeating values in the u-id column according to different ages. But different ages may have the same u-id, so the sum of the numbers shown in the pie chart does not match the card, due to the design of the power bi desktop.
When the age is [45-54], the unduplicated value of u-id is 1.
If you want to display the calculated sum of the unduplicated values of u-ids of different ages (in the example 3+6+1=10) on the card visual object, you can create a measure to be placed on the card visual object.
count of u-id by age range = sumx(VALUES('Unified 2 16 23 v 16b'[D1. Age Range]),'Unified 2 16 23 v 16b'[DistinctCountMeasure])Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you so much for your response, however this didn't solve my issue. Since I don't have the permission to upload the pbix here, I've uploaded the pbix file to WeTransfer and here is the link for it. This pbix includes a pie chart for Age Range. I'm facing the same issue. It calculates the distinct IDs properly on the card but the same doesn't translate to Power BI.
It can be becuase of the other columns I have but I'm not sure about it.
TIA.
Hi PRFInstitute ,
When you place in the card visual object, the distinguish count counts the number of all non-repeating values in the u-id column only (i.e. un1-un6,un8-9, 8 in total), and when you add a classification of age to the pie chart, the distinguish count counts the number of all non-repeating values in the u-id column according to different ages. But different ages may have the same u-id, so the sum of the numbers shown in the pie chart does not match the card, due to the design of the power bi desktop.
When the age is [45-54], the unduplicated value of u-id is 1.
If you want to display the calculated sum of the unduplicated values of u-ids of different ages (in the example 3+6+1=10) on the card visual object, you can create a measure to be placed on the card visual object.
count of u-id by age range = sumx(VALUES('Unified 2 16 23 v 16b'[D1. Age Range]),'Unified 2 16 23 v 16b'[DistinctCountMeasure])
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.