0
0
Power BIbi_tool~10 mins

Relationships (one-to-many, many-to-many) in Power BI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a one-to-many relationship between Sales and Customers tables.

Power BI
Relationship = CREATE_RELATIONSHIP(Sales[CustomerID], Customers[[1]])
Drag options to blanks, or click blank then click option'
ACustomerID
BOrderID
CProductID
DSalesID
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a column that does not uniquely identify customers.
Using a column from Sales table instead of Customers.
2fill in blank
medium

Complete the DAX formula to calculate total sales amount using the related table.

Power BI
Total Sales = SUMX(Sales, Sales[Quantity] * Sales[[1]])
Drag options to blanks, or click blank then click option'
APrice
BCustomerID
COrderDate
DDiscount
Attempts:
3 left
💡 Hint
Common Mistakes
Using CustomerID or OrderDate instead of Price.
Using Discount which is not part of the multiplication here.
3fill in blank
hard

Fix the error in the DAX formula to count unique customers in Sales table.

Power BI
Unique Customers = DISTINCTCOUNT(Sales[[1]])
Drag options to blanks, or click blank then click option'
AOrderID
BSalesAmount
CProductID
DCustomerID
Attempts:
3 left
💡 Hint
Common Mistakes
Using OrderID or ProductID which count orders or products, not customers.
Using SalesAmount which is numeric and not an ID.
4fill in blank
hard

Fill both blanks to create a many-to-many relationship between Products and Suppliers tables.

Power BI
Relationship = CREATE_RELATIONSHIP(Products[[1]], Suppliers[[2]])
Drag options to blanks, or click blank then click option'
AProductID
BSupplierName
CSupplierID
DProductName
Attempts:
3 left
💡 Hint
Common Mistakes
Using names instead of IDs which may not be unique.
Mixing product and supplier columns incorrectly.
5fill in blank
hard

Fill all three blanks to filter Sales by related Customers from a specific city.

Power BI
Filtered Sales = CALCULATE(SUM(Sales[Amount]), Customers[[1]] = "[2]", Sales[[3]] > 0)
Drag options to blanks, or click blank then click option'
ACity
BNew York
CQuantity
DOrderDate
Attempts:
3 left
💡 Hint
Common Mistakes
Using OrderDate instead of Quantity for sales filtering.
Using wrong city name or column.