Creating Pie Charts

  1. Okay let’s try loading our own data – this time based on some qualitative humanities data. Power BI is not meant to work directly with text data files, but you can use other better-suited textual analysis tools to create datasets that you can then visualize in Power BI. What I did was take the freely available text for Shakespeare’s play Romeo and Juliet. I ran it through a free online tool called Voyant Tools and it generated a word frequency table that we are now going to use as our dataset. If you want to learn more about textual analysis and visualization tools, such as Voyant, you can take a look at the Tools & Tutorials page in the Data Visualization guide.
  2. Let’s load this word frequency data into Power BI. From the Home menu (top ribbon), select Get Data, Excel Workbook.

    Importing own data via the Home menu

  3. Pick RomeoAndJulietWordFrequenciesByAct.xls (navigate to where you saved the data). From the data preview window, select the only sheet in the file, TermFrequenciesByAct.

    You can see that it is a simple spreadsheet that counts how many times a term/word came up in each act. At the bottom, you’ll see a button that says Transform Data. This opens up the Power Query Editor tool where you can do data cleaning tasks, such as cleaning up blank rows or columns, changing a column type to date, and highlighting columns and selecting unpivot to convert from wide format to long format. We don’t need to do those tasks on this dataset, so we’ll leave it as is for now and just click on Load Data.

    Selecting and Loading our own data

  4. Let’s click on new page to get started. Let’s rename this one to “Pie”.

    Adding a Pie report page

  5. Let’s first make a simple pie chart to show how many words are in each Act of the play, to see which Act is the longest and shortest and how they contribute to the whole.
  6. Before we begin building our visualization, let’s make sure our variables are correct. If we expand our dataset on the Data panel and look at what the variable types Power BI has identified in our dataset, you’ll notice that it thinks Act is a numeric variable that you can sum, when really it is text in this case (the sections of the play are divided into numbered acts, but you wouldn’t do math with these numbers). So let’s change it. If you click on Act, you’ll see at the top a new menu has appeared called Column tools. For the Data Type, it says Whole number, but you can fix it. Click on the dropdown menu arrow and select Text.

    Misclassified data typeChanging column data type for Act

  7. Now we are ready to create a pie chart. Select the Pie chart icon from the Visualizations panel, and drag the corner so it fills the page.

    Adding a Pie Chart and resizing

  8. Drag the Act variable from the Data panel to the Legend, Add data fields here box on the Visualizations panel (nothing will display at this point). Next, drag the Count variable from the Data panel to the Values, Add data fields here box on the Visualizations panel.

    Adding data to our Pie Chart

  9. Next, let’s work with the formatting. It is automatically showing the percentages, which is great, but also showing other information. Let’s have it just display percentages. Go to the Format your visual section of the Visualizations panel. Expand Detail labels, and for Label contents, select Percent of total.

    Selecting Pie Chart Labelling parameter

  10. Expand Values and change the font size to 14pt to make the labels more legible. We could also format the percentages to round to whole numbers. Further down under Values, change the Percentage decimal places to 0.

    Pie Chart labelling properties (font, decimals, etc.)

  11. You will notice we also have an issue with the legend not being in order. We can fix this with sorting. Click on the three dots at the top right of the visual. Select Sort Axis, Act. Go back to Sort Axis and select Sort ascending. Now the legend and the slices are in the order the Acts are in the play.

    Adjusting the legend for our Pie chart

  12. We can see the number of words used is quite evenly distributed throughout the acts, but Act 3 uses the most and Act 5 uses the least.

    Sample Final Pie Chart

Technique: Data Visualization | Tools: Power BI | Data Format: Statistics


First created: September 05, 2025
Last updated: August 21, 2026

Tutorial maintained by Kelly Schultz.

Tutorial created by Kelly Schultz.

Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International icon