Pie Chart in SSRS is useful to display the High-level data, and Sometimes, it can be visually pleasing if we show the data in Pie Chart. For example, Sales by region, Countrywide customers count, etc.
SQL Command we used in the above screenshot is:
SELECT Geo.[EnglishCountryRegionName] AS [Country] ,Geo.[StateProvinceName] AS [State] ,Geo.[City] ,Cust.FirstName +' '+ Cust.LastName AS [Full Name] ,Cust.EnglishEducation AS Education ,Cust.EnglishOccupation AS Occupation ,SUM(Cust.YearlyIncome) AS YearlyIncome ,SUM(Fact.SalesAmount)AS SalesAmount FROM DimCustomer AS Cust INNER JOIN FactInternetSales AS Fact ON Cust.CustomerKey = Fact.CustomerKey INNER JOIN [DimGeography] AS Geo ON Cust.GeographyKey = Geo.GeographyKey GROUP BY Geo.[EnglishCountryRegionName] ,Geo.[StateProvinceName] ,Geo.[City] ,Cust.FirstName ,Cust.LastName ,Cust.EnglishEducation ,Cust.EnglishOccupation ORDER BY [Country]
Creating a Pie Chart in SSRS
When you drag and Drop the Chart from Toolbox to Design space, a new window called Select Chart Type will be opened to select the required chart from the available once. In this example, we are selecting Simple Pie Chart.
Once you click on the Ok button, the Pie chart will display in the design region with dummy data.
Click on the empty space around the SSRS Pie Chart will open the Chart Data window
- Values: Any Numeric (Metric) value such as sales amount, Tax, Total Sales, Customer count, etc. All these values will be aggregated using an aggregate function (Sum, Count, etc.) because we are grouping them with the category group items.
- Category Group: Please specify the Column name on which you want to partition your Pie Chart.
In this example, we will create a Pie chart for Sales by country. So, Drag and drop the Sales Amount column from dataset to chart data values and Country Name in the category group.
Click on the Preview button to see the report preview.
If you see the above SSRS Pie Chart screenshot, It is providing a precise result. Still, we are unable to recognize the difference between Sales in France and Sales in Germany. To solve these situations, use the Data Labels.
Right-click on the pie chart and select the Show Data Labels option from the context menu to show the values
Click on the Preview button to see the Pie Chart in SSRS report preview.
NOTE: Please refer to Formatting Pie Chart article to understand the steps involved in formatting labels, legends, and pallets.