Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk6 min

Power BI Data Modelling: Relationships, Joins and Query Folding

Understand Power BI relationships, cardinality, filter direction, active and inactive paths, Power Query merge kinds, key integrity, and query folding.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In Power BI, use a model relationship to let report queries filter between loaded tables; use a Power Query merge to join and reshape query data before it enters the model. A sound model usually keeps facts at a consistent grain and connects them to dimensions through one-to-many relationships. Choose a merge when the prepared output itself needs joined columns or rows, and check whether its transformations can fold to the source.

How relationships and joins differ

Question Model relationship Power Query merge
When does it operate? In the semantic model, when report queries are evaluated. During query preparation, before data is loaded or refreshed into the model.
What does it control? Filter propagation between model tables. Which source rows match and what joined data is included in the query output.
Does it itself remove unmatched rows? No. A relationship is not a chosen join kind that permanently removes nonmatching rows. It depends on the selected join kind; inner joins retain matches only, while other kinds retain different sets of rows.

For regular one-to-many relationships, Power BI’s engine can expand tables at query time using left-outer semantics. That internal evaluation behavior is not the same as choosing a join kind in Power Query. See Microsoft’s explanations of star-schema design and model relationships.

As an Amazon Associate I earn from qualifying purchases.

How to structure facts and dimensions

Start with the job each table performs. Dimension tables provide the descriptive fields people use to filter and group results—such as product, customer, or date. Fact tables hold events or observations to summarize, such as sales transactions. Microsoft’s star-schema guidance puts it plainly: “Dimension tables enable filtering and grouping.”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep each fact table at a consistent grain: decide what one row represents, and avoid mixing records at different levels of detail in the same fact table without a clear reason. In a common star schema, a dimension is on the one side of a one-to-many relationship and a fact is on the many side. This gives report users clear dimensions for grouping measures across facts. See Microsoft’s star-schema guidance.

How cardinality and filter direction work

Cardinality describes the uniqueness of the values in the columns used to relate tables. On a one-to-many relationship, the key on the one side must be unique; the many side can contain repeated values. If duplicate values appear in a column used as the one-side key when data refreshes, the refresh can fail. Power BI may detect relationships when loading data, but verify that the detected keys, cardinality, and filter behavior match the intended model. Microsoft documents the relationship options in Create and Manage Relationships in Power BI Desktop.

Cardinality Meaning Key check
One-to-many (1:*) One row on one table can relate to multiple rows on the other. The one-side key must be unique; the many-side key may repeat.
Many-to-one (*:1) The same one-to-many arrangement viewed from the other table. The table marked as the one side must have a unique key.
One-to-one (1:1) Each key value relates to at most one row on either side. Both relationship columns must be unique.
Many-to-many (*:*) Key values can repeat on both sides. Neither side is guaranteed to provide a unique lookup key.

Cross-filter direction determines how a filter on one table propagates across a relationship. Single direction is the common starting point for one-to-many relationships: filters flow from the one side toward the many side. Bi-directional filtering can help with a specific reporting requirement, but paths that loop or connect multiple fact tables through shared dimensions can become ambiguous and may affect performance. Enable it deliberately and check the resulting paths rather than using it as a general fix. See Model relationships in Power BI Desktop and Create and Manage Relationships in Power BI Desktop.

When a many-to-many relationship is a poor default

A direct many-to-many relationship between two fact tables can make it harder for users to group and filter results as expected and can expose data-integrity problems. For flexible reporting, add the relevant dimensions and connect each fact table to those dimensions with one-to-many relationships. Use a direct many-to-many pattern only when its behavior fits the model and the reporting need; Microsoft’s many-to-many relationship guidance describes the limitations and alternatives.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When to use active and inactive relationships

Only one relationship between a pair of model tables can be active at a time. The active relationship supplies the default filter path for ordinary report interactions. An inactive relationship does not act as a second independently selectable default path in a report; a DAX calculation can invoke it with USERELATIONSHIP.

A common example is a date dimension connected to a fact table by both order date and ship date. If users need to use both date roles simultaneously in report filtering, separate role-playing date tables can provide two active paths. If the alternate relationship is needed only for a particular measure, keeping it inactive and using USERELATIONSHIP in that calculation may suit the model better. See Active vs inactive relationship guidance.

Other DAX functions address relationship behavior in calculations: CROSSFILTER can change or disable filter propagation for a calculation, RELATED and RELATEDTABLE access related values in row context, and TREATAS applies values from a table expression as filters to otherwise unrelated columns. These calculation-level tools do not replace a well-designed model.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to merge queries in Power Query

Use Merge when query output needs columns or rows brought together based on matching keys. In Power Query, a merge matches one or more column pairs and creates a nested table column for the matches from the right-hand query; you can then expand that column to select fields or aggregate its contents. Microsoft’s Merge Queries overview describes the operation and join choices.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the join kind by which rows must survive

Join kind Rows retained
Left outer All rows from the left query and matching rows from the right.
Right outer All rows from the right query and matching rows from the left.
Full outer All rows from both queries, including unmatched rows.
Inner Only rows with matches in both queries.
Left anti Rows from the left query with no match in the right.
Right anti Rows from the right query with no match in the left.

For example, a left outer merge keeps every row from the left query even where the right query has no match; an inner merge drops those unmatched rows. Pick the kind based on the output you need, not on how you plan to relate the loaded tables later.

Check keys and results before relying on the merge

  • Use matching meanings. Select columns that represent the same key, even if their column names differ.
  • Check data types. Paired key columns should have compatible data types so values can match as intended.
  • Order composite keys consistently. When matching on multiple columns, select corresponding columns in the same order in both queries.
  • Inspect match and row counts. If a lookup key expected to be unique contains duplicates, one left row can match multiple right rows. Expanding the nested results can therefore increase output row counts.
  • Check unmatched records. The join kind controls whether unmatched records remain in the result; verify that this matches the intended data preparation.

What query folding means for a merge

Query folding is Power Query’s attempt to translate supported transformation steps into operations that a data source can execute. Folding can be full, partial, or absent, depending on the connector, source, and sequence of transformations. Structured sources with query engines commonly support folding for supported operations; CSV and Excel sources do not provide a source query engine for this kind of folding. A merge is not guaranteed to fold just because it joins two queries. Microsoft’s query evaluation and folding guidance explains the concept and its dependencies.

Microsoft’s Power BI guidance says DirectQuery and Dual storage-mode tables must achieve query folding. For Import models using relational sources, folding can improve refresh performance when transformations can be represented as a source query. When steps instead run in the mashup engine, unnecessary work can matter more as the model grows. Check folding indicators or diagnostics for the actual connector and transformation sequence rather than assuming the merge runs at the source.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.