0
0
Power BIbi_tool~8 mins

Unpivoting columns in Power BI - Dashboard Guide

Choose your learning style9 modes available
Dashboard Mode - Unpivoting columns
Business Question

How can we transform monthly sales data from columns into rows to analyze sales trends easily?

Sample Data: Monthly Sales by Product
ProductJanFebMar
Apples100120130
Bananas809095
Cherries506070
Dates404550
Elderberries303540
Dashboard Components
  • Unpivoted Table: Shows sales data with columns Product, Month, and Sales. This is created by unpivoting the Jan, Feb, and Mar columns into rows.
  • Total Sales by Month (KPI Card): Displays total sales for each month.
    Formula (DAX measure):
    Total Sales = SUM('UnpivotedData'[Sales])
  • Sales Trend Line Chart: X-axis: Month, Y-axis: Sales, Legend: Product. Shows how sales change over months for each product.
Dashboard Layout
+----------------------+---------------------+
| Total Sales by Month | Sales Trend Line    |
|      (KPI Card)      |      (Line Chart)   |
+----------------------+---------------------+
|                Unpivoted Table               |
+----------------------------------------------+
Interactivity

Adding a slicer for Product allows filtering the unpivoted table, KPI card, and line chart to show data only for the selected product(s). Selecting a month in the line chart highlights sales for that month in the table and updates the KPI card accordingly.

Self Check

If you add a filter to show only Product = Bananas, which components update and what changes occur?

  • The unpivoted table shows only rows for Bananas with months Jan, Feb, Mar and their sales.
  • The Total Sales KPI card updates to show the sum of Banana sales for all months (80 + 90 + 95 = 265).
  • The Sales Trend Line Chart shows only the Banana sales trend over the three months.
Key Result
Dashboard showing monthly sales trends by unpivoting monthly columns into rows for easy analysis.