0
0
Power BIbi_tool~8 mins

Basic arithmetic in DAX in Power BI - Dashboard Guide

Choose your learning style9 modes available
Dashboard Mode - Basic arithmetic in DAX
Business Question

How much total revenue and profit did each product generate, and what is the average profit per sale?

Sample Data
ProductUnits SoldUnit PriceUnit Cost
Notebook1053
Pen2021
Eraser1510.5
Marker831.5
Ruler1242
Dashboard Components
  • KPI Card: Total Revenue
    Formula: Total Revenue = SUMX(Sales, Sales[Units Sold] * Sales[Unit Price])
    Result: 10*5 + 20*2 + 15*1 + 8*3 + 12*4 = 50 + 40 + 15 + 24 + 48 = 177
  • KPI Card: Total Profit
    Formula: Total Profit = SUMX(Sales, Sales[Units Sold] * (Sales[Unit Price] - Sales[Unit Cost]))
    Result: (10*(5-3)) + (20*(2-1)) + (15*(1-0.5)) + (8*(3-1.5)) + (12*(4-2)) = 20 + 20 + 7.5 + 12 + 24 = 83.5
  • KPI Card: Average Profit per Sale
    Formula: Average Profit per Sale = DIVIDE([Total Profit], SUM(Sales[Units Sold]))
    Result: 83.5 / (10+20+15+8+12) = 83.5 / 65 = 1.2846
  • Table: Sales Details
    Columns: Product, Units Sold, Unit Price, Unit Cost, Revenue, Profit
    Revenue formula per row: Units Sold * Unit Price
    Profit formula per row: Units Sold * (Unit Price - Unit Cost)
Dashboard Layout
+----------------------+----------------------+----------------------+
|   Total Revenue KPI   |    Total Profit KPI  | Average Profit per   |
|                      |                      |       Sale KPI       |
+----------------------+----------------------+----------------------+
|                      Sales Details Table                      |
|                                                              |
+--------------------------------------------------------------+
Interactivity

A slicer for Product allows filtering all KPIs and the sales details table to show data only for the selected product(s). When a product is selected, the Total Revenue, Total Profit, and Average Profit per Sale update accordingly, and the table shows only rows for that product.

Self Check

If you add a filter to show only the product Pen, which components update and what are their new values?

  • Total Revenue: 20 units * $2 = $40
  • Total Profit: 20 units * ($2 - $1) = $20
  • Average Profit per Sale: $20 / 20 units = $1
  • Sales Details Table: Shows only the row for Pen with calculated Revenue $40 and Profit $20
Key Result
Dashboard showing total revenue, total profit, and average profit per sale by product with interactive filtering.