Your Product dimension uses a natural composite key: ProductCode (text) and CountryCode (2-letter ISO). The Sales fact table stores both columns. In Power BI Desktop you attempt to create a relationship but discover you can select only one column. Without altering the source systems, how can you create a single active one-to-many relationship between Product and Sales?
Enable bidirectional cross-filtering between ProductCode and CountryCode so Power BI treats the two columns as a composite key automatically.
Generate a surrogate integer key in the Sales fact table by hashing ProductCode and CountryCode and relate it to the original columns in the Product table.
Add a calculated column to both tables that concatenates ProductCode and CountryCode, then create a one-to-many relationship on that new column.
Create two separate relationships, one on ProductCode and one on CountryCode, and set both to active.
Power BI relationships can only be defined on a single column. When source data relies on a composite key, the typical solution is to generate an equivalent single column in each table. Concatenating ProductCode and CountryCode (for example, ProductCode | CountryCode) produces identical values in both the dimension and fact tables, enabling a one-to-many relationship from Product to Sales. Bidirectional filters, multiple active relationships, or a key created only in the fact table would not satisfy the requirement.
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.
What is a composite key in databases?
Open an interactive chat with Bash
Why does Power BI require relationships to be created on a single column?
Open an interactive chat with Bash
How does concatenating columns help create relationships in Power BI?
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 .