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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
lmlearning
New Member

Pie/Donut Chart - Percentage of Total with Distinct Count

Hello,

I am fairly new to Power BI and have tried searching through this forum for help on my question to no avail. I am trying to build a pie/donut chart with distinct count but found that the visual will use a grand total of the distinct count from each category instead of the distinct count of the whole (like it does in the table). Is there a specific meausre I need to use to force it to to give me the percentage of total like it does in the table? Dummy data and screenshots below.

 

Expectation:

  • Distinct Count of ID for Type (e.g. how many unique IDs bought the type of product) and the percentage of total of distinct count (i.e. 7 different people bought the 4 products listed).
  • Percentage of total on the pie chart to reflect the % in the table on the upper right of the screenshot (total = 7).

Result:

  • Percentage of total on the pie chart shows % of the grand total of each category (total = 10), which double counts certain IDs.

I've tried doing distinct count 3 different ways and still gives me the same result:

  • Right-click in values in the visual for distinct count
  • Measure = DISTINCTCOUNT ('TEST-Table'[ID] )
  • Measure = CALCULATE DISTINCTCOUNT ('TEST-Table'[ID]) , ALL ('TEST-Table') )
IDDateType
AA1/1/2021Desk
AA1/1/2020Desk
AA12/20/2020Desk
AA12/20/2021Desk
BB1/1/2021Desk
BB1/1/2020Desk
BB12/20/2020Desk
BB12/20/2021Desk
CC6/8/2020Chair
CC12/20/2020Chair
DD12/20/2021Chair
EE1/1/2021Chair
EE1/1/2020Chair
EE1/1/2021Chair
EE1/1/2020Mat
EE12/20/2020Mat
EE12/20/2021Mat
EE6/8/2020Phone
EE12/20/2020Chair
FF1/1/2021Mat
FF1/1/2020Mat
GG12/20/2020Mat
GG12/20/2021Phone
GG1/1/2021Phone

 

lmlearning_0-1648143762170.png

Thank you in advance for your help!!

5 REPLIES 5
lmlearning
New Member

Hi Syk,

Thank you for the explanation! It brings to light some context I was missing with thinking about counts.

 

With that in mind, let's say I do want to intentionally count number of unique IDs to come to a total of 7 in the pie chart so I can arrive at the percentage shown outside of the parentheses in the screenshot below, is there a way to do so? (Sorry if this is a dumb question.)

 

To get the intended pecentages, I used this:

Measure =
VAR DistCountID = DISTINCTCOUNT('TEST-Table'[ID])
VAR TotalID = CALCULATE(DISTINCTCOUNT('TEST-Table'[ID]), ALL('TEST-Table'))
RETURN
DIVIDE(DistCountID, TotalID)
 
But even if I turn off the percentage of total label in the pie chart visual, when I hover over the slices, it would still give me percentage of total in parentheses.

 

lmlearning_0-1648148079469.png

lmlearning_1-1648154721536.png

 

Thank you again!

You can turn off tooltips!

Syk_0-1648218024390.png

 

I feel silly not having known that! Thank you so much for your time!!

Syk
Super User
Super User

I believe its doing what you want. The reason you are getting 10 is because you have a certain ID purchasing more than 1 type of item (ID EE buys chair, mat, and phone)

Also, your distinct count column is totaling incorrectly. They should both say 10 in each table.

I should mention, the reason your total is wrong is because the total is counting the number of distinct IDs with no regard to what they bought (so 7 total people).. The rest of the column counts each ID specific to what type of item was bought (EE is 1 person counted in the total but you could find them in 3 of those rows). I hope this makes sense!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.