DEV Community

Rodney Nyamu
Rodney Nyamu

Posted on

Relationships, Schemas, and Joins in Power BI: What I Learned as a Beginner

I'll be honest — when I first opened Power BI, I thought I could just drag in a spreadsheet, throw a chart on the canvas, and call it a day. Then my instructor gave us an assignment involving two tables instead of one, and suddenly nothing matched up. That's when I ran headfirst into the concepts of relationships, schemas, and joins — and this post is basically me explaining them the way I wish someone had explained them to me a earlier.

Why One Table Isn't Enough

In Excel, I got used to keeping everything in a single sheet. Power BI works differently — it wants you to split data into multiple tables (like a Sales table and a Products table) and then connect them. At first this felt like extra work for no reason, until I realized it stops you from repeating the same product name a thousand times across every row. That's when it clicked: this is basically how real databases are organized.

Relationships: The "Connecting Wires"

A relationship is just a link between two tables based on a common column — usually an ID. In my case, Products had a ProductID column, and so did Sales. Power BI lets you drag one onto the other in the Model view, and it draws a little line between them. That line means: "these two tables can now talk to each other."

Most relationships are one-to-many — one product can appear in many sales rows, but each sale only points to one product. Power BI shows this with a 1 on one side and a * on the other. Once I understood that symbol, the whole Model view stopped looking like spaghetti.

Schemas: Giving the Chaos a Shape

Once you have a few tables connected, you technically have a schema — just a fancy word for "how your tables are arranged and related to each other." The pattern I kept seeing recommended (and the one my course pushed us toward) is the star schema:

  • One central fact table (the "what happened" data — sales, transactions, orders)
  • Several dimension tables around it (products, customers, dates)

Picture the fact table in the middle and the dimension tables branching off it like points of a star — hence the name. I tried building a "snowflake" version once (where dimension tables connect to other dimension tables too), and honestly, for a beginner project, star schema was way easier to keep track of.

Joins: Where Excel-Me Got Confused

This is the part that tripped me up most, because Excel doesn't really have an equivalent. In Power Query (the "Get & Transform" section of Power BI), a join happens when you use Merge Queries to combine two tables before they even hit the model. The main types I used were:

  • Left Outer — keep everything from my main table, add matches from the other
  • Inner — keep only rows that match in both tables

I mixed these up constantly at first. My rule of thumb now: if I'm not sure, start with Left Outer, since it won't silently delete rows I didn't mean to lose.

Top comments (0)