Power BI Pie Charts are very useful to visualize the High-level data. For example, Sales by Continent or region, Orders by Country, Customers by region, or Sales by Main product Group, etc. Let us see how to Create a Pie Chart in Power BI with example.
For this pie chart in power bi example, we are going to use the SQL Data Source that we created in our previous article.
Please refer to Connect Power BI to SQL Server article to understand the Power BI Data Source.
How to Create a Pie Chart in Power BI
When you click on the Pie Chart under the Visualization section, automatically create a Pie Chart, as shown in the below screenshot.
To add data to Power Bi Pie Chart, we have to add the required fields:
- Legend: Drag the column that you want to display as the legend.
- Details: Please specify the Column name on which you want to partition your Pie Chart. Values split based on this field.
- Values: Any Numeric value, such as sales amount, Total Sales, Customer count, etc.
In this example, we create a Pie chart for Sales Amount by country Names. So, Drag the Sales Amount column to the Values field.
Next, checkmark the English Country Region Name, or Drag and drop it to Legend region automatically create a Pie Chart for you.
Hover over any slice show you the Tool-tip of Country Name and Its Sales Amount
Second Approach to Create a Pie Chart in Power BI
Drag and Drop the Sales Amount from Fields section to Canvas automatically create a Bar Chart, as shown in the below screenshot.
By clicking the Pie Chart in the Visualization, converts the Bar Chart to Pie Chart.
Add the Country Name to legend. Remember, we haven’t added anything to the Details section. So, it considers English Country Region Name (legend) as the Details.
If I add State Provide Name to the Details (explicitly), then Power BI Pie Chart displays the Sales by State province Name, and legend displays the Country Name.
Let me do some quick formatting of this pie chart
NOTE: I suggest you to refer Format Pie Chart article to understand the steps involved in formatting legend, Data Color, Background Color, Title, and Slice colors.
How to Format Power BI Pie Chart with examples?. Formatting Power BI Pie Chart includes changing the Legend and Title position, Slice and background Colors etc.
To demonstrate these formatting options, we are going to use the Pie Chart that we created earlier. Please refer Pie Chart in Power BI article to understand the steps involved in creating Power BI Pie Chart.
How to Format Power BI Pie Chart
Please click on the Format button to see the list of available formatting options for this Pie Chart.
Format Legend of a Power Bi Pie Chart
To display the Legend, Please select the Legend region and change the option from Off to On. From the below screenshot, you can see the legend
Legend Position: Use the drop-down box to change the Pie Chart legend position as per your requirements. For now, we are selecting the Top Center.
Title: Toggle on to display Legend title i.e EnglishCountryRegionName
Legend Name: You can change the Legend name. Here, we are changing its Country names
Color: Use the Color pallet to add color to legend
As you can see from the below screenshot, we changed the Font family to Comic Sans, and font size to 14
Format Data Colors of a Power BI Pie Chart
Data Colors means changing the Slice Colors. Use this section to change the default slice colors to the required ones.
For the demonstration purpose, we changed the France Color to Violet.
Format Detail labels of a Power BI Pie Chart
Detail labels also called data labels. Use this section to format the slice information
Label Style: By default, it displays the Category (Column Value) as the Label. Here we are changing it to All details labels. It means each slice shows the information about the Filed Name, Sales Amount, and the Percentage of Total.
Let me change the Color of a Label to Green. You can also change the Display Units from Auto to Millions or Trillions.
We changed the Decimal Values for Amount and Percentage of Total to 2, Font family to Comic Sans, and Text size to 12
From the screenshot below, you can see all the changes that we made so far.
Format Title of a Power Bi Pie Chart
To display the Pie Chart Title, Please select the Title, and change the option from Off to On.
As you can see from the below screenshot, we change the Title Text, Color, Font style, Font Size, and Title Alignment to center
Add Background Color to Pie Chart in Power BI
By toggling the Background option to On, it allows you to add the Background color to Pie Chart. For the demonstration purpose, we are adding a background color. Here, you can change the Transparency percentage as well.
Add Border Colors to Pie Chart in Power BI
By toggling the Border option to On allows you to add Borders to Pie Chart. For the demonstration purpose, we are adding Green color as the Border color.
Use the General Section to Change the X, Y position, and Width and height of a Pie Chart