By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
For engineers who need to model data correctly, avoid report errors, and pass the PL-300 exam.
You’re building a Power BI report for a sales team. Your data comes from: - A Sales table (transactions, dates, amounts) - A Products table (product IDs, categories, costs) - A Customers table (customer IDs, regions, loyalty tiers)
You drag a Sales[ProductID] column into a table visual and expect to see Products[Category]. Instead, you get blank values or duplicates. Why? Because Power BI doesn’t know how these tables connect.
Relationships define how tables interact. Active vs. inactive relationships determine which path Power BI uses to filter data. Mess this up, and: - Your reports show wrong numbers (e.g., sales totals double-counting).- DAX measures return incorrect results (e.g., SUM(Sales[Amount]) ignores filters).- Performance tanks (Power BI scans unnecessary data).
SUM(Sales[Amount])
Real-world scenario:You inherit a Power BI report where Sales connects to Dates via OrderDate (active) and ShipDate (inactive). A measure like TOTALSALES = SUM(Sales[Amount]) only respects OrderDate. If a user filters by ShipDate, the measure ignores the filter—leading to misleading dashboards.
OrderDate
ShipDate
TOTALSALES = SUM(Sales[Amount])
Sales[ProductID]
Products[ProductID]
Employees[EmployeeID]
HRData[EmployeeID]
Students[StudentID]
Courses[CourseID]
COUNTROWS()
Products
Sales
USERELATIONSHIP
SalesProducts
Dates
DeliveryDate
Goal: Connect Sales to Dates via OrderDate (active) and ShipDate (inactive).
SaleID
ProductID
CustomerID
Amount
Date
Year
Month
Day
ProductName
Category
Sales[OrderDate]
Dates[Date]
Sales[ShipDate]
Dates[Year]
Sales[Amount]
dax Sales by ShipDate = CALCULATE( SUM(Sales[Amount]), USERELATIONSHIP(Sales[ShipDate], Dates[Date]) )
Sales by ShipDate
Scenario: A product can be sold in multiple regions, and a region can have multiple products.1. Create a bridge table ProductRegions: - Columns: ProductID, RegionID 2. Load it into Power BI.3. Create relationships: - Products[ProductID] → ProductRegions[ProductID] (1:) - Regions[RegionID] → ProductRegions[RegionID] (1:) - Sales[ProductID] → Products[ProductID] (1:) 4. Cross-filter direction: Set both to "Both"* (so filters flow in all directions).
ProductRegions
RegionID
ProductRegions[ProductID]
Regions[RegionID]
ProductRegions[RegionID]
Region
dax [Region] = LOOKUPVALUE(User[Region], User[Email], USERPRINCIPALNAME())
Sales_Products
Sales[ProductID] → Products[ProductID] (Active)
CALCULATE(..., USERELATIONSHIP(...))
❌ Active relationship (only one can be active).
"How do you resolve a many-to-many relationship?"
❌ Direct relationship (Power BI won’t allow it).
"What happens if you create two active relationships between the same tables?"
❌ Power BI picks one randomly (it doesn’t).
"How do you filter a measure by an inactive relationship?"
CALCULATE(SUM(Sales[Amount]), USERELATIONSHIP(Sales[ShipDate], Dates[Date]))
FILTER(Sales, Sales[ShipDate] = Dates[Date])
You have: - A Sales table with OrderDate and ShipDate.- A Dates table.- An active relationship: Sales[OrderDate] → Dates[Date].- An inactive relationship: Sales[ShipDate] → Dates[Date].
Sales[OrderDate] → Dates[Date]
Sales[ShipDate] → Dates[Date]
Task: Create a measure that shows sales by ship date (ignoring OrderDate).
Sales by ShipDate = CALCULATE( SUM(Sales[Amount]), USERELATIONSHIP(Sales[ShipDate], Dates[Date]) )
Why it works:- USERELATIONSHIP temporarily activates the inactive path for this measure.- CALCULATE applies the filter context.
CALCULATE
CALCULATE(..., USERELATIONSHIP(Table1[Col], Table2[Col]))
"If your report shows blank values or duplicates, 90% of the time it’s a relationship issue. Check cardinality, active/inactive status, and cross-filter direction first."
Now go build something that doesn’t break! ?
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.