Topic 9 of 12

Building Dashboards (Power BI / Tableau)

Power BI and Tableau power the world's best dashboards. Learn to build interactive reports that executives love.

๐Ÿ“šIntermediate
โฑ๏ธ20 min
โœ…6 quizzes

Power BI vs Tableau

| Feature | Power BI | Tableau | |---------|----------|---------| | Cost | $10-20/user | $15-70/user | | Ease of use | โ˜…โ˜…โ˜…โ˜…โ˜… | โ˜…โ˜…โ˜…โ˜…โ˜† | | Microsoft integration | Excellent | Limited | | Customization | Good | Excellent | | Market share | #1 in business | #1 in enterprise |

Recommendation: Learn Power BI first (easier, cheaper, more jobs).

Power BI Basics

1. Data Import

Connect to: Excel, SQL, CSV, APIs, web

measure.daxDAX
// Example data source
= Excel.Workbook(File.Contents("C:\\data\\sales.xlsx"))

2. Data Model

Create relationships between tables (like SQL joins).

Example:

  • Sales table โ†’ Product table (via product_id)
  • Sales table โ†’ Customer table (via customer_id)

3. DAX Formulas (Data Analysis Expressions)

Calculate total revenue:

measure.daxDAX
Total Revenue = SUM(Sales[Amount])

Calculate YoY growth:

measure.daxDAX
YoY Growth =
DIVIDE(
    [Total Revenue] - CALCULATE([Total Revenue], SAMEPERIODLASTYEAR(Calendar[Date])),
    CALCULATE([Total Revenue], SAMEPERIODLASTYEAR(Calendar[Date]))
)

Top 10 customers:

measure.daxDAX
Top 10 Customers =
TOPN(10, ALL(Customers[Name]), [Total Revenue], DESC)

4. Visualizations

Drag & drop fields to create:

  • Card (single number)
  • Bar/Column chart
  • Line chart
  • Table/Matrix
  • Map
  • Slicers (filters)

5. Interactive Filters

Add slicers for:

  • Date range
  • Region
  • Product category
  • Customer segment

Tableau Basics

1. Connect to Data

Similar to Power BI - Excel, SQL, CSV, etc.

2. Sheets & Dashboards

  • Sheet = Single visualization
  • Dashboard = Multiple sheets combined

3. Calculated Fields

Total Revenue:

code.txtTABLEAU
SUM([Amount])

Profit Margin:

code.txtTABLEAU
([Revenue] - [Cost]) / [Revenue]

Running Total:

code.txtTABLEAU
RUNNING_SUM(SUM([Amount]))

4. Parameters

Create interactive inputs:

  • Date picker
  • Metric selector (Revenue vs Profit)
  • Top N filter

Dashboard Design Workflow

Step 1: Define Purpose

Questions to answer:

  • Who is the audience? (Executive, analyst, operations)
  • What decisions will this drive?
  • How often will it be viewed?

Step 2: Choose Metrics

Executive Dashboard:

  • Revenue, Profit, Growth %
  • Top products, regions
  • Trends

Sales Dashboard:

  • Sales by rep
  • Pipeline status
  • Conversion rates

Step 3: Sketch Layout

F-Pattern example:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Revenue โ”‚ Profit โ”‚ Growth% โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ Monthly Trend (Line Chart) โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ Top 10 โ”‚ Geographic Map โ”‚ โ”‚ Products โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Step 4: Build in Tool

Import data โ†’ Create measures โ†’ Build visuals โ†’ Arrange layout

Step 5: Add Interactivity

  • Slicers/filters
  • Drill-through
  • Tooltips
  • Buttons

Real Example: Sales Dashboard

Goal: Track sales performance by region and product.

Power BI Steps:

  1. Import data

    • Sales table
    • Products table
    • Regions table
  2. Create relationships

    • Sales โ†’ Products (product_id)
    • Sales โ†’ Regions (region_id)
  3. Build measures

    measure.daxDAX
    Total Sales = SUM(Sales[Amount])
    Target Achievement = DIVIDE([Total Sales], [Target])
  4. Create visuals

    • Card: Total Sales
    • Bar: Sales by Region
    • Line: Monthly Trend
    • Table: Top Products
  5. Add slicers

    • Date range
    • Region
    • Product category

Best Practices

โœ… One page, no scrolling โ€” All key info visible โœ… Limit to 5-7 visuals โ€” Don't overcrowd โœ… Consistent colors โ€” Same metric = same color โœ… Mobile-friendly โ€” 40% of views are mobile โœ… Fast load time โ€” Optimize data model โœ… Clear titles โ€” Every visual labeled

Performance Tips

  1. Limit data โ€” Filter to recent dates
  2. Use aggregations โ€” Don't load raw rows
  3. Optimize DAX โ€” Avoid nested CALCULATEs
  4. DirectQuery vs Import โ€” Import is faster

Summary

โœ… Power BI easier for beginners, Tableau more customizable โœ… DAX/Calculated Fields for custom metrics โœ… F-pattern layout for dashboards โœ… Interactive filters enhance usability โœ… Optimize for performance

Next: Statistics for Data Analytics! ๐Ÿ“ˆ