Building Your First Power BI Dashboard

Building Your First Power BI Dashboard – DataScienceWay tutorial

Power BI Desktop is Microsoft’s free tool for building interactive reports. You connect it to your data, build a few visuals, and readers can click a bar or a slicer to filter everything on the page. If you already use Excel pivot tables, you have most of the concepts you need; Power BI adds a proper data model, better visuals and easy interactivity.

This tutorial builds a complete first dashboard from scratch: generating sample data, loading it, creating a simple star-schema model, writing three measures, building the visuals, adding slicers and formatting the page. It assumes no prior Power BI experience.

What you need

  • Power BI Desktop, free from the Microsoft Store or Microsoft’s website. It runs on Windows only; Mac users can run it in a Windows virtual machine or use the more limited web editor.
  • Sample data. The Python script below creates three CSV files. If you do not use Python, you can build similar tables in Excel.

Microsoft updates Power BI monthly, so the exact position of buttons may differ slightly from the descriptions here; the concepts do not change.

Step 1: Create the sample data

import numpy as np
import pandas as pd

rng = np.random.default_rng(2024)

products = pd.DataFrame({
    "ProductID": range(1, 9),
    "Product": ["Desk", "Chair", "Lamp", "Monitor", "Keyboard", "Mouse", "Headset", "Webcam"],
    "Category": ["Furniture", "Furniture", "Lighting", "Electronics",
                 "Electronics", "Electronics", "Electronics", "Electronics"],
    "UnitPrice": [250, 120, 30, 180, 45, 20, 60, 70],
})
stores = pd.DataFrame({
    "StoreID": range(1, 6),
    "Store": ["Leeds", "Manchester", "Bristol", "Glasgow", "Cardiff"],
    "Region": ["North", "North", "South", "Scotland", "Wales"],
})
n = 3000
dates = pd.to_datetime("2024-01-01") + pd.to_timedelta(rng.integers(0, 366, n), unit="D")
sales = pd.DataFrame({
    "SaleID": range(1, n + 1),
    "Date": dates.strftime("%Y-%m-%d"),
    "ProductID": rng.integers(1, 9, n),
    "StoreID": rng.integers(1, 6, n),
    "Quantity": rng.integers(1, 6, n),
})
sales = sales.merge(products[["ProductID", "UnitPrice"]], on="ProductID")
sales["Revenue"] = sales["Quantity"] * sales["UnitPrice"]
sales = sales.drop(columns="UnitPrice").sort_values("SaleID")

products.to_csv("Products.csv", index=False)
stores.to_csv("Stores.csv", index=False)
sales.to_csv("Sales.csv", index=False)
print(sales.head(), len(sales))

This gives a fact table (Sales: one row per transaction, with numbers) and two dimension tables (Products and Stores: descriptive attributes). Dates use ISO format so Power BI reads them correctly regardless of regional settings.

Step 2: Load the data

  1. Open Power BI Desktop and choose Get data > Text/CSV.
  2. Select Sales.csv, check the preview, then click Transform Data.
  3. In the Power Query Editor, confirm the column types: Date as Date, Quantity and Revenue as whole or decimal numbers, IDs as whole numbers.
  4. Use New Source > Text/CSV to add Products and Stores the same way.
  5. Click Close & Apply.

Checking types in Power Query, rather than later, avoids many problems. For messier data, see Cleaning Data with Power Query.

Step 3: Build the model

Open Model view (the third icon on the left). Power BI may already have detected relationships from matching column names. You want:

Star schema diagram with a central Sales fact table linked to Date, Product, Store and Customer dimension tables by one-to-many relationships
Dimension tables filter the fact table; that direction is what makes slicers work.
  • Products[ProductID] (one) → Sales[ProductID] (many)
  • Stores[StoreID] (one) → Sales[StoreID] (many)

If a relationship is missing, drag ProductID from Products onto ProductID in Sales. Double-click a relationship line to check it is one-to-many with a single cross-filter direction. This shape – a central fact table surrounded by dimension tables – is called a star schema, and it is the layout Power BI works best with.

Step 4: Add a date table

Time-based analysis works best with a dedicated calendar table. In Table view or Report view, choose Modeling > New table and enter:

Date =
ADDCOLUMNS (
    CALENDAR ( DATE ( 2024, 1, 1 ), DATE ( 2024, 12, 31 ) ),
    "Year", YEAR ( [Date] ),
    "Month Number", MONTH ( [Date] ),
    "Month", FORMAT ( [Date], "mmm" ),
    "Quarter", "Q" & QUARTER ( [Date] )
)

Then:

  1. Select the new table and choose Table tools > Mark as date table, selecting the Date column.
  2. Select the Month column and use Column tools > Sort by column > Month Number, otherwise months sort alphabetically (Apr, Aug, Dec…).
  3. In Model view, relate Date[Date] (one) to Sales[Date] (many).

Step 5: Create measures

Measures are calculations that respond to filters. Create them with Home > New measure, selecting the Sales table first so they are stored there:

Total Revenue = SUM ( Sales[Revenue] )

Total Units = SUM ( Sales[Quantity] )

Avg Revenue per Sale = DIVIDE ( [Total Revenue], COUNTROWS ( Sales ) )

DIVIDE safely returns blank rather than an error when dividing by zero. Using explicit measures rather than dragging raw columns into visuals is good practice: you control the calculation and can reuse it everywhere. For much more on this, see DAX Measures for Beginners.

Format the measures: select Total Revenue, then in Measure tools set the format to Currency and choose £.

Step 6: Build the visuals

Switch to Report view. Click an empty part of the canvas before choosing each visual, so you create a new one rather than changing the selected one.

Wireframe of a one-page dashboard: a header with slicers, four KPI cards, a large revenue-by-month line chart, a revenue-by-product bar chart and a top-stores table
A wireframe of the page layout: the most important number goes top left.
  1. KPI cards: add three Card visuals, each showing one measure – Total Revenue, Total Units and Avg Revenue per Sale. Place them in a row across the top.
  2. Trend: add a Line chart. Put Date[Month] on the X-axis and Total Revenue on the Y-axis.
  3. Category comparison: add a Clustered bar chart with Products[Category] on the Y-axis and Total Revenue on the X-axis. Sort by revenue (the “…” menu on the visual).
  4. Store detail: add a Table or Matrix visual with Stores[Store], Total Units and Total Revenue.

Always take fields for slicing and axes from the dimension tables (Products, Stores, Date), not from ID columns in Sales. This ensures filters flow correctly through the model.

Step 7: Add interactivity

  • Cross-filtering: click a category bar and every other visual filters to it. Click again to clear. This works automatically thanks to the relationships.
  • Slicers: add a Slicer visual with Stores[Region] and another with Date[Quarter]. Format them as tiles or drop-downs in the Format pane.
  • Edit interactions: if you do not want a visual to be filtered by another, select the source visual and use Format > Edit interactions.

Step 8: Format for readability

  • Give every visual a clear title that says what it shows, such as “Revenue by month, 2024”.
  • Use one accent colour; avoid rainbow palettes. View > Themes applies consistent colours.
  • Align visuals using Format > Align, and leave white space between them.
  • Put the most important numbers top-left, where people look first.
  • Remove unnecessary gridlines, borders and decimal places.

The design principles from Matplotlib Basics – sorted bars, honest axes, minimal clutter – apply equally here.

Step 9: Save and share

Save the file as a .pbix. To share an interactive report, you publish it to the Power BI service (Home > Publish). Sharing with colleagues normally requires a paid licence for both publisher and viewers, or a workspace on a capacity licence; check Microsoft’s current licensing for your organisation. Never use “Publish to web” for confidential data – it makes a report publicly accessible to anyone with the link.

When the source CSVs change, click Home > Refresh in Desktop to reload them.

Common mistakes

  • Loading one giant flat table instead of a star schema. It works at first but makes measures and filters harder.
  • Using columns from the fact table for slicers instead of dimension tables.
  • Skipping the date table, which limits time intelligence and month sorting.
  • Bi-directional relationships everywhere, which can cause ambiguous or slow models. Keep single direction unless you have a specific reason.
  • Too many visuals on one page. Five or six focused visuals beat fifteen.
  • Implicit measures (dragging raw numeric columns) instead of explicit DAX measures.

FAQ

Is Power BI Desktop really free?

Yes, Desktop is free for building reports. Sharing through the online service typically needs a licence.

Can Power BI use Excel files?

Yes. Use Get data > Excel workbook. Format your data as Excel Tables first for reliable imports.

Power BI or Excel?

Excel suits ad-hoc analysis and smaller datasets; Power BI suits shared, interactive dashboards and larger, multi-table models. See Excel vs Python for a broader comparison of tools.

How much data can it handle?

Imported data is compressed heavily, so millions of rows are routine on a normal laptop. Limits on file size in the service depend on your licence.

Next steps

Go deeper with DAX Measures for Beginners, keep sources clean with Power Query, and if you are coming from spreadsheets, revisit Excel Pivot Tables to see how the concepts map.

LJ

About the author: Lucky Joseph

Lucky is a UK-based writer with a data science background who runs DataScienceWay. Every tutorial is tested before publication; if you spot something that no longer works, please get in touch.

More about DataScienceWay · Contact