Power BI Advanced - Complex Modelling Patterns
Complex Modelling Patterns
Learn how to model many-to-many relationships, bridge tables, factless facts, disconnected parameters and other analytical scenarios that cannot be handled by a simple star schema alone.
Module overview
A conventional star schema should remain the default design for most Power BI semantic models. However, real organizational data does not always fit into a single set of one-to-many relationships.
Examples include:
- A customer who owns several accounts
- An account jointly owned by several customers
- A salesperson assigned to several regions
- A student enrolled in several courses
- A project involving several employees
- Sales transactions and targets stored at different grains
- User-controlled parameters that should not directly filter data
These scenarios require deliberate modelling patterns. An incorrect many-to-many design can produce duplicated results, ambiguous filter paths, poor performance or totals that appear correct but are conceptually invalid.
Learning outcomes
After completing this module, participants will be able to:
- Identify genuine many-to-many business relationships
- Distinguish many-to-many dimension and fact-table scenarios
- Design and validate a bridge table
- Explain the purpose of a factless fact table
- Use shared dimensions to connect multiple facts
- Handle facts stored at different levels of granularity
- Design disconnected parameter tables
- Apply SELECTEDVALUE and TREATAS appropriately
- Recognize ambiguous filter paths and double counting
- Select an appropriate modelling pattern for a scenario
1. Why complex patterns are necessary
A standard star schema assumes that every dimension member has a unique key and that one dimension row can relate to many fact rows.
For example:
One row per product
Many sales per product
Sales and profit
This design becomes insufficient when a dimension member can belong to multiple members of another dimension or when two analytical tables contain repeated relationship keys.
2. Understand relationship cardinality
| Cardinality | Meaning | Typical use |
|---|---|---|
| One-to-many | One table contains a unique key; the other contains repeated matching values | Dimension-to-fact relationship |
| One-to-one | Both relationship columns contain unique values | Special cases where two tables share the same row-level grain |
| Many-to-many | Both relationship columns can contain duplicate values | Selected complex scenarios requiring careful validation |
Cardinality is a technical relationship property, but the correct configuration must follow the business meaning of the data.
3. The three common many-to-many scenarios
Dimension to dimension
Two business entities have multiple associations in both directions.
Example: customers and bank accounts.
Fact to fact
Two fact tables contain repeated values and must be analysed through shared dimensions.
Example: sales actuals and sales targets.
Higher-grain fact
One fact table stores information at a less detailed level than another fact table.
Example: daily sales and monthly category targets.
4. Dimension-to-dimension relationships
Business scenario: customers and accounts
A customer may own multiple accounts, while an account may have multiple joint owners.
For example:
| Customer | Account |
|---|---|
| Customer 91 | Account 1 |
| Customer 92 | Account 1 |
| Customer 92 | Account 2 |
| Customer 93 | Account 2 |
Neither customer nor account can be stored as a single foreign key inside the other dimension without losing valid associations.
The recommended solution is a bridge table containing one row for each customer-account association.
Unique CustomerID
CustomerID + AccountID
Unique AccountID
Required tables
| Table | Grain | Key requirement |
|---|---|---|
| DimCustomer | One row per customer | CustomerID must be unique |
| DimAccount | One row per account | AccountID must be unique |
| BridgeCustomerAccount | One row per customer-account association | The CustomerID and AccountID combination should be unique |
5. Bridge-table design
A bridge table resolves a many-to-many relationship by explicitly recording valid associations between business entities.
Characteristics of a well-designed bridge
- Its grain is one valid association between two entities
- It contains the keys required to identify both entities
- Duplicate key combinations are removed or justified
- Its filter behaviour is deliberately configured
- Unmatched and unknown keys are handled
- Its business ownership and refresh process are known
Bridge-table validation questions
- What exactly does one bridge row represent?
- Can the same association appear more than once?
- Can an association become active or inactive over time?
- Does the relationship require effective start and end dates?
- Should one member receive full or allocated credit?
- Could filter propagation create an ambiguous path?
6. Allocation in bridge-table models
Some many-to-many scenarios require an allocation rule. For example, a sale may be credited to several salespeople.
| Sale | Salesperson | Allocation |
|---|---|---|
| Sale 1001 | Amira | 60% |
| Sale 1001 | Daniel | 40% |
The bridge can store an allocation factor to prevent the sale from being counted twice.
7. Factless fact tables
A factless fact table records business events or associations without containing numeric measure columns. It normally contains dimension keys only.
Event tracking
Records that an event happened, even when the event has no numeric amount.
Example: one customer signed in to a website at a particular date and time.
Entity association
Records a valid relationship between members of two dimensions.
Example: one salesperson is assigned to one sales region.
Example: employee training attendance
A factless table could contain:
- EmployeeKey
- CourseKey
- DateKey
- AttendanceStatusKey
Although the table has no amount column, a measure can count its rows:
It can answer questions such as:
- How many employees attended each course?
- Which departments have the lowest participation?
- How many courses did each employee complete?
- How did attendance change by month?
8. Fact-to-fact analysis
Fact tables should generally not be directly related to each other. They should be connected through dimensions that represent compatible business entities.
Example: actual sales and targets
Actual sales
Date, Product, Region
Sales targets
This structure permits the same date, product and region filters to affect both actual sales and targets.
9. Facts with different grains
A common advanced modelling problem occurs when facts are stored at different levels of detail.
Example grains
| Fact table | Grain |
|---|---|
| FactSales | One product, customer, store and day transaction line |
| FactTargets | One product category, region and month |
Sales can be analysed by individual products and dates. Targets cannot, because their source grain is category and month.
Valid target analysis
- Month, quarter and year
- Product category or higher
- Region or organizational total
Potentially misleading target analysis
- Target by individual product
- Target by individual transaction date
- Target by customer when targets contain no customer key
10. Direct many-to-many relationships
Power BI supports direct many-to-many relationship cardinality. However, it should be used only after the business scenario and filter behaviour have been carefully evaluated.
Possible advantages
- Fewer tables in selected simple scenarios
- Direct representation of repeated relationship values
- Useful when neither table can act as a unique dimension
Potential risks
- Unexpected or non-additive totals
- Ambiguous filter propagation
- Reduced model clarity
- Difficult troubleshooting
- Limited relationships in certain composite-model scenarios
11. Disconnected tables
A disconnected table has no physical relationship to the rest of the semantic model. It is intentionally used to capture a user selection or provide values for a calculation.
Common uses
What-if analysis
Let users select a discount, growth rate, exchange rate or cost adjustment.
Measure selection
Let users switch a visual between revenue, profit, quantity and customer count.
Scenario selection
Let users compare actual, budget, forecast and alternative scenarios.
Example: discount parameter
Create a disconnected table containing possible discount values:
Read the selected value with:
Apply it in a measure:
12. Virtual relationships with TREATAS
The TREATAS function applies values from one table as filters to columns in another table. It can create relationship-like behaviour inside a measure without adding a physical relationship to the model.
Example: disconnected region selection
Appropriate uses
- Specialized calculations using disconnected selectors
- Applying filters between tables without a physical relationship
- Resolving selected virtual-relationship scenarios
When not to use it
- To conceal a poorly designed semantic model
- When a clear physical relationship should exist
- When users need consistent filter propagation across all measures
13. Composite keys and multi-column relationships
Power BI relationships normally connect one column in one table to one column in another table. When uniqueness depends on several columns, a composite key may be required.
Example
A monthly target may be identified by:
- Year
- Month
- Region
- Product category
A combined key can be created during data preparation:
Composite-key safeguards
- Use the same data type and format in both tables
- Include a delimiter to prevent accidental collisions
- Handle null and blank values consistently
- Validate uniqueness on the intended one side
- Create the key upstream where practical
In DirectQuery scenarios, Microsoft also documents COMBINEVALUES for selected multi-column relationship requirements.
14. Filter-direction decisions
Complex patterns sometimes require filters to cross a bridge table. Nevertheless, bidirectional filtering should not be enabled throughout the model without a specific reason.
Decision questions
- Which table should initiate the filter?
- Which business entities should become visible after filtering?
- Does another active path already connect the tables?
- Will row-level security use the same path?
- Could the path produce ambiguous propagation?
- Can the requirement be handled inside a measure instead?
15. Pattern-selection guide
| Business scenario | Recommended starting pattern |
|---|---|
| One unique dimension member relates to many facts | Standard one-to-many relationship |
| Two dimensions have multiple associations | Bridge or factless fact table |
| Two fact tables must be compared | Shared conformed dimensions |
| Actual and target facts have different grains | Separate fact tables with compatible shared dimensions |
| User selects a numerical assumption | Disconnected what-if parameter |
| User switches between measures | Field parameter or disconnected selector |
| A filter is required for only one calculation | Virtual relationship with TREATAS |
| Uniqueness depends on several columns | Validated composite key |
16. Worked modelling example
Scenario
A consulting company needs to analyse project revenue by employee, department and skill. Each employee can work on many projects, and each project can involve many employees.
Proposed tables
| Table | Grain |
|---|---|
| DimEmployee | One row per employee |
| DimProject | One row per project |
| BridgeProjectEmployee | One employee assignment to one project |
| FactProjectRevenue | One project and accounting month |
| DimDate | One row per calendar date |
Design issue
Project revenue exists at project level, not employee level. If the full revenue is displayed for every assigned employee, totals will be duplicated.
Possible business solutions
- Show project revenue only at project level
- Allocate revenue equally among assigned employees
- Allocate revenue according to recorded working hours
- Allocate revenue using an approved contribution percentage
17. Model-validation process
Write one sentence explaining what each row represents.
Confirm that every intended dimension key is unique.
Identify duplicated or missing entity associations.
Verify which tables are filtered from each dimension.
Check model totals against authoritative source totals.
Validate totals when users select several bridge members.
Confirm that unmatched keys do not silently remove facts.
Explain measures that cannot be summed across certain dimensions.
18. Common modelling mistakes
| Mistake | Likely consequence | Recommended correction |
|---|---|---|
| Using many-to-many because duplicate keys exist | Unclear or incorrect filtering | Investigate the grain and create a proper dimension |
| Connecting two fact tables directly | Ambiguous filtering and duplicated values | Connect through shared dimensions |
| Leaving duplicate bridge combinations | Repeated associations and inflated calculations | Validate the bridge's composite key |
| Ignoring allocation requirements | Full values attributed to several members | Apply an approved allocation rule |
| Using bidirectional filtering everywhere | Ambiguous paths and performance problems | Enable it only for justified paths |
| Relating a parameter to the fact table | Parameter values incorrectly remove fact rows | Keep the parameter disconnected |
| Using TREATAS for every relationship | Hidden logic and difficult maintenance | Prefer physical relationships for reusable filtering |
| Comparing facts below their supported grain | Misleading targets, budgets or forecasts | Restrict analysis or apply governed allocation |
19. Hands-on laboratory
Lab: Model project assignments and revenue
Participants receive employee, project, assignment, timesheet and monthly project-revenue tables.
Task 1: Declare the grain
- Define the grain of every supplied table.
- Identify dimensions, facts and bridges.
- Identify repeated and unique keys.
Task 2: Create the bridge
- Create one row per project-employee association.
- Remove unjustified duplicate combinations.
- Validate unmatched employees and projects.
Task 3: Configure relationships
- Create dimension-to-bridge relationships.
- Configure the required filter path.
- Avoid ambiguous active relationships.
Task 4: Address allocation
- Calculate each employee's project hours.
- Calculate the employee's share of project hours.
- Allocate project revenue using that share.
- Confirm that allocated revenue equals total project revenue.
Task 5: Add a disconnected parameter
- Create a projected growth-rate parameter.
- Use the parameter in a projected-revenue measure.
- Confirm that the parameter does not filter fact rows.
Expected deliverable
A validated semantic model containing employee and project dimensions, a project-assignment bridge, revenue facts, timesheet facts, allocation measures and a disconnected growth parameter.
20. Knowledge check
21. Complex-model checklist
- Every table has a documented grain
- Many-to-many relationships reflect real business rules
- Bridge rows represent unique valid associations
- Shared dimensions connect compatible fact tables
- Different fact-table grains are clearly documented
- Allocation rules are approved and validated
- Disconnected tables are intentionally disconnected
- Virtual relationships are used only where appropriate
- Bidirectional relationships do not create ambiguity
- Totals agree with authoritative source totals
- Blank and unmatched keys have been tested
- Complex behaviour is documented for report creators