0
0
Power BIbi_tool~8 mins

Role-playing dimensions in Power BI - Dashboard Guide

Choose your learning style9 modes available
Dashboard Mode - Role-playing dimensions
Business Question

How can we analyze sales data by different date roles like Order Date and Ship Date using the same Date dimension?

Sample Data
OrderIDOrderDateShipDateProductSalesAmount
10012024-01-052024-01-10Widget A250
10022024-01-072024-01-12Widget B450
10032024-01-102024-01-15Widget A300
10042024-01-122024-01-18Widget C500
10052024-01-152024-01-20Widget B400

DateKeyDateYearMonthDay
202401052024-01-052024January5
202401072024-01-072024January7
202401102024-01-102024January10
202401122024-01-122024January12
202401152024-01-152024January15
202401182024-01-182024January18
202401202024-01-202024January20
Dashboard Components
  • KPI Card: Total Sales by Order Date
    Formula: Total Sales OrderDate = SUM(Sales[SalesAmount])
    This shows total sales filtered by the Order Date role of the Date dimension.
  • KPI Card: Total Sales by Ship Date
    Formula: Total Sales ShipDate = CALCULATE(SUM(Sales[SalesAmount]), USERELATIONSHIP(Sales[ShipDate], Date[Date]))
    This calculates total sales using the Ship Date role of the Date dimension.
  • Line Chart: Sales Over Time by Order Date
    Axis: Date[Date]
    Values: Total Sales OrderDate measure
    Shows sales trend by order date.
  • Line Chart: Sales Over Time by Ship Date
    Axis: Date[Date]
    Values: Total Sales ShipDate measure
    Shows sales trend by ship date.
  • Table: Sales Details
    Columns: OrderID, Product, OrderDate, ShipDate, SalesAmount
    Shows raw sales data for reference.
Dashboard Layout
+---------------------------+---------------------------+
| Total Sales by Order Date | Total Sales by Ship Date  |
+---------------------------+---------------------------+
|                           |                           |
|  Line Chart: Sales by     |  Line Chart: Sales by     |
|  Order Date               |  Ship Date                |
|                           |                           |
+---------------------------+---------------------------+
|                           Sales Details Table                          |
+-----------------------------------------------------------------------+
Interactivity

Filters on the Date dimension will affect the charts and KPIs differently depending on the active relationship:

  • When filtering by Order Date, the Total Sales by Order Date KPI and its chart update.
  • When filtering by Ship Date, the Total Sales by Ship Date KPI and its chart update.
  • The Sales Details Table always shows all sales rows and updates based on slicers for Product or OrderID.
  • Using slicers on Date with USERELATIONSHIP in measures allows switching between date roles without duplicating the Date table.
Self Check

If you add a filter selecting dates from 2024-01-10 to 2024-01-15 on the Date dimension:

  • Which KPI card updates to show sales only for orders placed in that date range?
  • Which KPI card updates to show sales only for shipments in that date range?
  • How does the Sales Details Table change?
Key Result
Dashboard showing sales analysis by Order Date and Ship Date using role-playing Date dimension.