0
0
Power BIbi_tool~8 mins

SWITCH function in Power BI - Dashboard Guide

Choose your learning style9 modes available
Dashboard Mode - SWITCH function
Dashboard Goal

Understand how sales performance varies by product category and show a clear label for each category using the SWITCH function.

Sample Data
Order IDProduct CategorySales Amount
1001Electronics250
1002Clothing150
1003Electronics300
1004Furniture450
1005Clothing200
1006Furniture350
1007Electronics400
Dashboard Components
  • KPI Card: Total Sales
    Formula: Total Sales = SUM('Sales'[Sales Amount])
    Result: 2100
  • Calculated Column: Category Label
    Formula:
    Category Label = SWITCH('Sales'[Product Category], "Electronics", "Tech Gear", "Clothing", "Apparel", "Furniture", "Home Goods", "Other")
    This replaces category names with friendly labels.
  • Bar Chart: Sales by Category Label
    Shows total sales grouped by the new Category Label.
  • Table: Sales Details
    Shows Order ID, Product Category, Sales Amount, and Category Label columns.
Dashboard Layout
+----------------------+----------------------+
|      Total Sales      |  Sales by Category   |
|       (KPI Card)      |      (Bar Chart)     |
+----------------------+----------------------+
|                Sales Details Table               |
+-------------------------------------------------+
Interactivity

A slicer on Product Category lets you filter all components. Selecting a category updates the KPI card, bar chart, and table to show only that category's data.

Self Check

If you add a filter for Product Category = Electronics, which components update and what will the Total Sales show?

  • All components update to show only Electronics data.
  • Total Sales will show 950 (250 + 300 + 400).
Key Result
Dashboard shows total sales and sales by friendly category labels using SWITCH function.