Forum Discussion

PRFInstitute's avatar
PRFInstitute
New Member
3 years ago
Solved

Power BI - Distinct Count not working

Hi, I've a Pie chart on my dashboard in Power BI. The Pie chart is based on the column that inlcudes duplicates. I have a card on my dashboard that shows me the number of distinct values in that colu...
  • Anonymous's avatar
    Anonymous
    3 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.