How to Create Yes and No Percentage Values for an Access Pie Chart
Question details
The user needs to display Yes and No categories as calculated percentage values rather than raw counts in a modern Microsoft Access pie chart.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Creating a modern pie chart in an Access form or report to visually summarize a Yes/No field representing broken versus working machines.
- Observed behavior
- The built-in modern chart calculates and displays the raw count of records but does not automatically convert or format these results as a percentage of the whole.
Ensure you have a working backup of your Access database before creating or modifying queries. Familiarize yourself with switching to the SQL View in the Access Query Design window to paste the necessary SQL syntax.
Use an Aggregate Query to Calculate Proportions
Create a custom SQL query that groups records by the Yes/No field and divides the count of each group by the total number of records to generate an exact decimal proportion.
Modern Access charts rely directly on the data returned by their source query. By manually calculating the proportion in the query itself, the chart can accurately format and display the resulting decimal values as true percentages.
Open your Access database, navigate to the Create tab on the ribbon, and click Query Design. Close the Add Tables dialog box without selecting anything.
Right-click the new query tab at the top of the workspace and select SQL View from the context menu.
Paste the following SQL code, replacing 'tblMachines' and 'Broken' with your actual table and field names: SELECT IIf([Broken],"Yes","No") AS BrokenStatus, Count(*)/(SELECT Count(*) FROM tblMachines) AS Percentage FROM tblMachines GROUP BY IIf([Broken],"Yes","No");
Run the query to verify the results and save it. Insert a modern Pie Chart onto your form, select this saved query as the Data Source, set Category to 'BrokenStatus', set Value to 'Percentage', and format the Data Labels as Percentages in the chart settings.

Use a Crosstab Query for Separate Categories
A crosstab query pivots your Yes/No data into distinct column headers, creating separate count metrics that can be easily utilized by modern charting tools.
Discover WPS Office for Easier Data Analysis and Charting
While Microsoft Access handles complex relational databases, WPS Spreadsheets offers an incredibly intuitive, lightweight, and free alternative for analyzing tabular data. You can generate stunning pie charts with automatic percentage calculations in seconds, completely bypassing the need to write complex SQL queries.
- 1. Input Your Data: Open a new blank workbook in WPS Spreadsheets and type 'Working' and 'Broken' with their respective counts into two columns.
- 2. Insert a Pie Chart: Highlight the data range, go to the Insert tab on the top ribbon, and click the Pie Chart icon.
- 3. Enable Percentage Labels: Click on the generated chart, select the Chart Elements icon (plus sign), check Data Labels, and format them to display Percentages automatically.

Frequently Asked Questions
Why doesn't the Access modern pie chart calculate percentages automatically?
Modern Access charts plot the exact numerical data returned by their underlying queries. If your query outputs raw integer counts instead of proportional decimals, the chart uses those raw counts. It does not perform internal division to find the percentage of the whole.
Can I just format my raw count data labels as percentages in the chart settings?
No. If you apply a percentage format to a raw integer (like the number 5), it will multiply it by 100 and display 500%. You must first calculate the decimal proportion (e.g., 0.05) within the SQL query before applying the percentage format.
Does the IIf function work in all versions of MS Access?
Yes, the IIf (Immediate If) function is a standard, built-in function in Microsoft Access across all versions. It is highly effective for evaluating a boolean condition (like a Yes/No field) and outputting specific text labels for your charts.




