A data analyst is modeling data in Power BI. They have a 'Products' dimension table and a 'Sales' fact table. The relationship between them should be based on a product identifier. However, the 'ProductSKU' column in the 'Products' table contains duplicate values, preventing the creation of a one-to-many relationship. What is the most effective approach in the Power Query Editor to establish a valid relationship key for the 'Products' table?
Establish a many-to-many relationship between the 'Products' and 'Sales' tables using the 'ProductSKU' column.
In the 'Sales' table, filter out all rows corresponding to the duplicate 'ProductSKU' values found in the 'Products' table.
Create a composite key by combining the 'ProductSKU' column with the 'ProductName' column.
Remove duplicate rows based on the 'ProductSKU' and then add an index column to serve as a new, unique surrogate key.
The correct answer is to remove duplicate rows and add an index column. In a star schema, the key column on the 'one' side of a one-to-many relationship must contain unique values. The best practice to resolve duplicate values in a dimension table is to remove the duplicate rows based on the business key (like 'ProductSKU') and then add an index column in Power Query. This new column acts as a surrogate key, providing a unique integer-based identifier for each row, which is optimal for model performance and relationship integrity.
Creating a composite key is a possible but less optimal solution, as joins on multiple columns or text columns are less performant than on a single integer key. Establishing a many-to-many relationship is not ideal as it is a workaround for the data quality issue, not a solution, and can lead to ambiguity and performance problems. Filtering rows from the 'Sales' fact table is incorrect as it would result in the loss of valid data and lead to inaccurate reports.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
Why is it necessary to remove duplicate rows when modeling a relationship in Power BI?
Open an interactive chat with Bash
What is a surrogate key, and why is it preferable for relationships in Power BI?
Open an interactive chat with Bash
Why is using a many-to-many relationship not an ideal solution for handling duplicate keys?
Open an interactive chat with Bash
Microsoft Power BI Data Analyst
Prepare the data
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .