PL-300 · Question #196
Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might…
The correct answer is A. Yes. The answer is Yes. When a Power BI model has multiple relationships between two tables, only one can be active at a time. The other relationships are inactive. To use an inactive relationship in a DAX measure, you use the USERELATIONSHIP() function inside CALCULATE(). For…
Question
Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution. After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen. You have a Power BI model that contains two tables named Sales and Date. Sales contains four columns named TotalCost, DueDate, ShipDate, and OrderDate. Date contains one column named Date. The tables have the following relationships:
Sales[DueDate] and Date[Date] Sales[ShipDate] and Date[Date] Sales[OrderDate] and Date[Date] The active relationship is on Sales[DueDate]. You need to create measures to count the number of orders by [ShipDate] and the orders by [OrderDate]. You must meet the goal without duplicating data or loading additional data. Solution: You create measures that use the CALCULATE, COUNT, and USERELATIONSHIP DAX functions. Does this meet the goal?
Exhibit
Options
- AYes
- BNo
How the community answered
(33 responses)- A76% (25)
- B24% (8)
Explanation
The answer is Yes. When a Power BI model has multiple relationships between two tables, only one can be active at a time. The other relationships are inactive. To use an inactive relationship in a DAX measure, you use the USERELATIONSHIP() function inside CALCULATE(). For example: CALCULATE([Total Sales], USERELATIONSHIP(Sales[OrderDate], Date[Date])). This allows the measure to filter by OrderDate (or ShipDate) instead of the default active DueDate relationship, meeting the goal of analyzing data against different date columns without changing the model's active relationship.
Topics
Community Discussion
No community discussion yet for this question.
