0
0
Power BIbi_tool~15 mins

SWITCH function in Power BI - Real Business Scenario

Choose your learning style9 modes available
Scenario Mode
👤 Your Role: You are a sales analyst at a retail company.
📋 Request: Your manager wants a report that categorizes each product's sales performance into 'Low', 'Medium', or 'High' based on total sales amount.
📊 Data: You have a sales data table with columns: ProductID, ProductName, SalesAmount.
🎯 Deliverable: Create a new calculated column using the SWITCH function to classify sales performance and build a simple table visual showing ProductName and its Sales Performance category.
Progress0 / 4 steps
Sample Data
ProductIDProductNameSalesAmount
101Notebook1200
102Pen300
103Desk Lamp800
104Chair1500
105Backpack400
106Calculator1000
107Stapler200
108Whiteboard1800
1
Step 1: Open Power BI Desktop and load the sales data table.
No formula needed.
Expected Result
Sales data table is loaded and visible in the Fields pane.
2
Step 2: Create a new calculated column named 'Sales Performance' in the sales data table.
Sales Performance = SWITCH(TRUE(), Sales[SalesAmount] < 500, "Low", Sales[SalesAmount] >= 500 && Sales[SalesAmount] < 1500, "Medium", Sales[SalesAmount] >= 1500, "High", "Unknown")
Expected Result
A new column 'Sales Performance' is added with values 'Low', 'Medium', or 'High' based on SalesAmount.
3
Step 3: Create a table visual on the report canvas.
Add 'ProductName' and 'Sales Performance' columns to the table visual.
Expected Result
Table visual shows each product with its sales performance category.
4
Step 4: Format the table visual for readability.
Adjust column widths and apply alternating row colors.
Expected Result
Table is easy to read with clear categories.
Final Result
-----------------------------------
| ProductName | Sales Performance |
-----------------------------------
| Notebook    | Medium            |
| Pen         | Low               |
| Desk Lamp   | Medium            |
| Chair       | High              |
| Backpack    | Low               |
| Calculator  | Medium            |
| Stapler     | Low               |
| Whiteboard  | High              |
-----------------------------------
Products with sales below 500 are classified as Low performance.
Sales between 500 and 1499 are Medium performance.
Sales 1500 and above are High performance.
This classification helps quickly identify which products need attention.
Bonus Challenge

Create a measure that counts how many products fall into each sales performance category and display it in a card visual.

Show Hint
Use the COUNTROWS and FILTER functions with the 'Sales Performance' column in your measure.