Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DIFF1
Helper II
Helper II

Difficulty with relationships creation

 Hello friends, 

 

 I have a difficulty creating relationships in Power BI. I thought I created them properly, but when I create visualizations i clearly understand smth is wrong. 

I will greatly appreciate if someone may give me an idea where I am wrong. 

I have 5 tables:

1. Last Ship Date - unique list of outbound itme and last ship date. (unique key)

2. Locations/Dimensions - locations and list of items in them (key is not unique, some key values are repeated)

3. Move Type - is in a sense a central table. It is a list of items that need to be moved. Unique key.

4. MAX Last Process Date -list of items and date when it was last processed. Unique key.

5. Title/Publisher/WAC/MSRP - Just a list of items with their description. Only table where i don't have a key. It is just a description of what the item is about. No measures, calculations nothing here. 

 

 

Can someone (who has more experience) in Power BI let me know if I connected smth not properly?

 

All the tables (with the exception on Title/Publisher/Type are connected on key. Title/Publisher/Type connected to all others on Item field.

Issue10.PNG

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @DIFF1 

 

In Power BI, relationships don't always need to be created on the Key columns. They can also be created on other columns. And you have several inactive relationships (dotted lines) in your model. These inactive relationships will not work when you drag columns directly into visuals. Only active relationship (solid lines) will be used to filter data according to their cross-filter directions. To use an inactive relationship, you need to use USERELATIONSHIP function in DAX expressions to activate an inactive relationship.

 

When you understand something is wrong, it is probably because the active relationship is not chosen or set up correctly. Which column are used in the visual? What is the active relationship between the two tables they are from? Are the columns in the relationship correct that you hope to lookup values based on these columns? When columns are correct, check the cross-filter directions. If tableA should filter tableB, it must have a relationship whose cross-filter direction points to tableB. 

 

As there could only be one active relationship between two tables, if you want to use two relationships at the same time, you could use USERELATIONSHIP to create a measure to get the result. 

 

These articles may be helpful:

Beginner’s Guide to Relationships in Power BI – Curbal

Create and manage relationships in Power BI Desktop - Power BI | Microsoft Docs

Model relationships in Power BI Desktop - Power BI | Microsoft Docs

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

DIFF1
Helper II
Helper II

Maybe someone knows?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.