Visualize SQL data with Pie and Map charts in Power BI to identify top-selling regions, countries, or sellers, and connect Power BI to Azure Log Analytics via the Kusto connector to display security alerts by severity using a Donut chart.
Task Details
1. Visualize your SQL database using a pie chart in Power BI.
Identify the best-selling regions, countries, or sellers, and customize the colors and fonts for improved visualization.
2. Visualize your SQL database using a map in Power BI.
Identify the best-selling regions, countries, or sellers, and adjust colors and fonts for a clear and engaging presentation.
3. Connect Power BI to Azure Log Analytics using the Kusto connector.
Use a donut chart to visualize the distribution of security alerts by severity level, providing a clear overview of alert categories and their impact.
Note: In this demo, I will use a sample SQL database for visualization.
*
Steps
Visualize your SQL database using a Pie Chart in Power BI
Use a Pie Chart in Power BI to visualize your SQL database and quickly identify top-selling regions, countries, or sellers with clear, customizable visuals.
Visualize you SQL database
1. Go to SQL database → Power platform → Power BI → Get started
*
2. Click on created .pbids file
*
3. You will be redirected to Power BI Desktop.
After authenticating to the Azure portal with your credentials, open the Navigator and select the tables you want to visualize.
Note: Before connecting, ensure your client IP address is added to the SQL Server firewall:
- Go to SQL Server → Networking → Add your client IPv4 address → Save.
*
In this demo I will choose them all.
*
4. Start with counting how many cities exist in each country (from the SalesLT.Address table).
Drag and drop "City" under "Values"
Drag and drop "Countryregion" under "Legend"
So right now:
- 295 (65.56%) → There are 295 city entries in the United States
- 115 (25.56%) → 115 in Canada
- 40 (8.89%) → 40 in the United Kingdom
These aren’t unique cities - it’s the number of address records that reference a city in that country.
*
5. Increase CountryRegion font size for better readability.
- Select the “Format your visual” (paint roller) icon.
- Go to Legend → Options.
- Increase the font size and adjust the color for improved visibility.
*
6. Increase the font size of percentage labels for clarity.
- Select the “Format your visual” (paint roller) icon.
- In the Visual tab, go to Detail labels → Options.
- Increase the font size and adjust the color for better readability.
*
7. Show Total Sales by Country
- Insert a new Pie Chart.
In the Data pane, configure the following:
- Values: SalesLT SalesOrderDetail → LineTotal → set aggregation to Sum.
- Legend: SalesLT Customer → CountryRegion (if unavailable, join Customer → Address → CountryRegion)
The chart will now display the total sales amount per country, where each slice represents one country’s total sales volume.
Label the visual as “Total Sales by CountryRegion.”
*
8. Modify the title font and color.
- Select “Format your visual” → General → Title.
- Adjust the font size, style, and color as desired.
Note: Apply the same styling to each chart for a consistent visual design.
*
9. Add a shadow effect to each chart for better visual distinction.
- Select the “Format your visual” (paint roller) icon.
- In the General tab, open Effects.
- Set Shadow to On.
Note: Apply this setting to each chart for a consistent appearance.
*
10. Identify Top Sellers
- Drag and drop SalesPerson under Y-axis.
- Drag and drop SalesOrderDetailID under X-axis.
- Drag and drop CountryRegion under Legend.
Note: This configuration categorizes sales by the number of orders.
This clustered bar chart visualizes the top sellers by username, grouped by country. Each bar represents a salesperson, and its length indicates total sales performance.
In this sample dataset, Jae0 (United Kingdom) achieved the highest number of sales, followed by Linda3 and Shu0 from the United States.
*
11. Replace Count of SalesOrderDetailID with Sum of LineTotal (from SalesLT SalesOrderDetail).
This change measures the total sales amount ($) instead of the number of orders.
This clustered bar chart visualizes the top sellers by username, grouped by country. Each bar represents a salesperson, and its length reflects total sales performance.
In this sample dataset, Jae0 (United Kingdom) achieved the highest total sales, followed by Linda3 and Shu0 from the United States.
































