0
0
Power BIbi_tool~15 mins

SQL Server connection in Power BI - Real Business Scenario

Choose your learning style9 modes available
Scenario Mode
👤 Your Role: You are a business analyst at a retail company.
📋 Request: Your manager wants you to create a sales report by connecting Power BI directly to the company's SQL Server database.
📊 Data: You have access to a SQL Server database with a Sales table containing columns: OrderID, OrderDate, Region, Product, Quantity, and SalesAmount.
🎯 Deliverable: Create a Power BI report that connects to the SQL Server database, loads the Sales data, and shows total sales by Region.
Progress0 / 4 steps
Sample Data
OrderIDOrderDateRegionProductQuantitySalesAmount
10012024-01-05EastWidget A10500
10022024-01-07WestWidget B5300
10032024-01-10EastWidget C7420
10042024-01-12NorthWidget A3150
10052024-01-15SouthWidget B8480
10062024-01-18WestWidget C6360
10072024-01-20NorthWidget B4240
10082024-01-22SouthWidget A9450
1
Step 1: Open Power BI Desktop and click on 'Get Data'. Select 'SQL Server' as the data source.
Server: Enter your SQL Server name or IP address. Database: Enter the database name containing the Sales table. Choose 'Import' or 'DirectQuery' mode.
Expected Result
Power BI connects to the SQL Server and shows a list of tables.
2
Step 2: Select the 'Sales' table from the list and click 'Load' to import the data into Power BI.
No formula needed; just select the table and load.
Expected Result
Sales data is loaded into Power BI with columns OrderID, OrderDate, Region, Product, Quantity, and SalesAmount.
3
Step 3: Create a new report page. Add a 'Table' visual to the canvas.
Drag the 'Region' column to Rows and 'SalesAmount' column to Values. Set aggregation of SalesAmount to SUM.
Expected Result
The table shows total sales amount for each region.
4
Step 4: Format the table visual for clarity: sort by total sales descending and add a title 'Total Sales by Region'.
Use visual formatting pane to set sorting and title.
Expected Result
The report clearly shows regions ranked by total sales.
Final Result
-----------------------------------
| Total Sales by Region            |
|---------------------------------|
| Region | Total Sales            |
|--------|------------------------|
| East   | 920                    |
| West   | 660                    |
| South  | 930                    |
| North  | 390                    |
-----------------------------------
South region has the highest total sales of 930.
East region follows closely with total sales of 920.
North region has the lowest sales at 390.
Bonus Challenge

Create a line chart showing monthly sales trends by region using the same SQL Server connection.

Show Hint
Use the OrderDate column to extract month and year, then aggregate SalesAmount by month and region.