11 November 2026

Power BI Multiple Tables: Import Data and Connect the Model

  Asp.Net CS By Example       11 November 2026

Power BI lesson: multiple tables

SalesProductId + AmountRelationshipMatching keyProductsName + Category

Original diagram created for this blog.

Why separate tables?

Separate tables reduce repeated text. Sales can store ProductId while Products stores ProductName and Category.

Connect them

  1. Load both tables.
  2. Open Model view.
  3. Connect Products[ProductId] to Sales[ProductId].
  4. Check that the Products key is unique.
  5. Use Category from Products with Amount from Sales.

Practice

Create Sales and Products CSV files, connect them, and compare a category chart with a manual total.

Worked example: products and sales

Use Home → Enter data to create Products with three rows: (1, Notebook, Stationery), (2, Pen, Stationery), (3, Backpack, Bags). The columns are ProductId, ProductName and Category. Create Sales with ProductId and Amount rows: (1, 1200), (2, 400), (1, 900), (3, 1600). ProductId repeats in Sales because a product can be sold more than once.

Products (one row per ProductId)   1 ───── *   Sales (many rows per ProductId)
  1. In Model view, connect Products[ProductId] to Sales[ProductId]. The relationship should be one-to-many (1:*).
  2. Create Total Sales = SUM(Sales[Amount]).
  3. Build a bar chart using Products[Category] and [Total Sales]. Stationery should be 2500; Bags should be 1600.

If each category shows 4100, the relationship may be missing or inactive. If Power BI refuses the one side, check for duplicate ProductId values in Products. Keep ProductId types the same in both tables. This simple model is easier to maintain than copying a product name into every sale row.

Return to the Power BI hub · Microsoft relationship documentation

logoblog

Thanks for reading Power BI Multiple Tables: Import Data and Connect the Model

Previous
« Prev Post

No comments:

Post a Comment

Please do not enter any spam link in the comment box.