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
mattmickeyj
Frequent Visitor

Not automatically detecting relationships

Hi,

 

I am very new to PowerBI - I have 2 tables, imported via a query using the advanced editor.  In options > current file > data load > relationships, all the 3 boxes are ticked, however PowerBI Desktop is failing to auto-detect relationships, even when I press autodetect in Manage Relationships.  The column headers are identical e.g. school and _Year

 

Screenshot 2020-05-15 at 11.18.39.png

Screenshot 2020-05-15 at 11.25.13.png

 

When I try to manually make more than 1 relationships I can't and I get the error:

Screenshot 2020-05-15 at 11.25.52.png

 

Any guidance would be really appreciated, thank you 🙂

 

Matt

4 REPLIES 4
v-alq-msft
Community Support
Community Support

Hi, @mattmickeyj 

 

Power BI Desktop looks at column names in the tables you're querying to determine if there are any potential relationships. If there are, those relationships are created automatically. If Power BI Desktop can't determine with a high level of confidence there's a match, it doesn't create the relationship.

 

It is suggested to define active relationships whenever possible. They widen the scope and potential of how your model can be used by report authors, and users working with Q&A. It means that role-playing dimension-type tables should be duplicated in your model. 

 

In specific circumstances, you may define one or more inactive relationships for a role-playing dimension-type table. You can consider this design when:

  • There's no requirement for report visuals to simultaneously filter by different roles
  • You use the USERELATIONSHIP  DAX function to activate a specific relationship for relevant model calculations

 

For further information, you may refer the following documents.

Create and manage relationships in Power BI Desktop 

Active vs inactive relationship guidance 

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Greg_Deckler
Super User
Super User

Autodetection is a bit of a black box. Power BI considers data types, names of columns, the values that are found in the columns, etc. 

 

There can only be one set of active relationship paths between 2 tables. It is no problem creating inactive relationships, you just need to use USERELATIONSHIP in your measure. The other thing that you can do is create a composite key by appending multiple columns into a single column in both tables. You can do that in Power Query or DAX.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks for that.  As I said I am very new to that - can you provide some steps as to how I would achieve that please?

@mattmickeyj Are you referring to a composite key or USERELATIONSHIP or both?

 

To concatenate columns in DAX is simply:

 

[Column1] & [Column2] & [Column 3] ...

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.