Menu
×
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP C C++ C# AWS W3.CSS HOW TO BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING HTML & CSS BASH RUST TOOLS MATH

Power BI Pie and Donut Charts


Share

Pie and Donut Charts

A pie chart shows how a total is split into parts.

Each slice is one category, and the size of the slice is that category's share of the total.

A donut chart is a pie chart with a hole in the middle.

Both answer one question: "What share of the whole does each part have?"

They work best with only a few parts.

This page uses your file from the DAX chapter, for example poke_mart_dax.pbix (see Power BI Visuals for what it holds), with the measure Total Sales.


Create a Pie Chart

Show each product category's share of Total Sales:

  1. Click an empty spot on the canvas.
  2. In the Visualizations pane, select Pie chart.
  3. Drag Products > Category to the Legend well.
  4. Drag Sales > Total Sales to the Values well.

The pie has three slices.

By default, each label shows the value and the share (Data value, percent of total).

To label each slice with its name and share instead, select Format visual, open the Visual tab, expand Detail labels > Options, and set Label contents to Category, percent of total.

CategoryTotal SalesShare of total
Balls4,447,20047.23%
Medicine4,413,60046.87%
Status Healers556,0005.90%
Total9,416,800100.00%

The pie makes one thing clear at a glance: Balls and Medicine each bring in almost half of the sales, and Status Healers only about 6%.

The shares always add up to 100%.

That is why a pie only makes sense when the parts together form a meaningful whole, like the three categories that make up all sales.


Create a Donut Chart

  1. Select the pie chart, and copy and paste it (Ctrl+C, Ctrl+V).
  2. With the copy selected, select Donut chart in the Visualizations pane.

The donut uses the same wells and shows the same shares as the pie.

A pie chart and a donut chart side by side, both showing Total Sales by Category with detail labels for Balls, Medicine and Status Healers and their percent of total

The hole in the middle leaves room for a label.

Center value, on the Visual tab of Format visual, is on by default and shows the total inside the ring, shortened to 9M.

The donut in the image has it turned off.

Otherwise, pie and donut charts work the same.

Choose the one you find easier to read.



When Not to Use a Pie Chart

Pie charts are popular, but they are easy to misuse.

Avoid them in these two cases.

1. Too Many Slices

Change the pie from categories to products: drag Products > Product to the Legend well, and remove Category.

The pie now has ten slices:

ProductTotal SalesShare of total
Poke Ball1,821,60019.34%
Great Ball1,677,60017.81%
Super Potion1,545,60016.41%
Potion1,527,00016.22%
Ultra Ball948,00010.07%
Revive723,0007.68%
Hyper Potion618,0006.56%
Paralyze Heal195,6002.08%
Awakening180,5001.92%
Antidote179,9001.91%
Total9,416,800100.00%

Ten colors are hard to match with the legend.

Super Potion and Potion look the same size.

The three smallest slices, Paralyze Heal, Awakening and Antidote, are thin wedges of about 2% each, and their labels crowd each other or disappear.

Microsoft recommends pie and donut charts for a small number of categories.

For ten products, use a bar chart sorted by value, like the one in Bar and Column Charts.

It shows the same ranking at a glance.

A pie chart of Total Sales by Product with ten slices, the smallest of them thin wedges with crowded labels, next to a clustered bar chart of the same data sorted from Poke Ball to Antidote

2. Slices That Are Hard to Compare

Go back to the three categories.

Which sells more, Balls or Medicine?

In the pie you cannot tell.

The slices are 47.23% and 46.87%, a difference of 33,600 in sales.

People judge angles and areas much less exactly than lengths, so two slices of almost the same size look equal.

If the order or the difference matters, use a bar chart sorted by value, add data labels, or show the numbers in a table.

Two or more pies side by side, for example one pie per region, are even harder to compare.

To compare the mix between groups, use a 100% stacked column chart instead.

Note: Use a pie or donut chart only when all of these are true: the parts add up to a meaningful whole, there are only a few parts, and the reader needs a rough idea of the shares, not exact comparisons.


Treemap: An Alternative

A treemap also shows the parts of a whole, but as rectangles instead of slices.

Select Treemap, put Category in the Category well, Product in the Details well and Total Sales in the Values well: each category becomes a colored block, split into one rectangle per product and sized by its sales.

Power BI places the largest rectangle at the top left and the smallest at the bottom right, so the ranking is easy to read, and a treemap has room for many more parts than a pie, all ten products in their three categories at once.



Free account

Track your progress

XP earned 0 Day streak 0 Spaces 0 League —

New

Learn in Adventure Mode W3Schools Adventure App

Coding fundamentals as bite-sized lessons and challenges.

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.

Copyright 1999-2026 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.