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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Fourthsky
Frequent Visitor

Cannot create active relationship between two tables

I have a very simple relational structure that I am attempting to build for my data model. 

 

I am using a Direct Query data source that has many tables but no built in relational model.

 

This question relates to 3 tables only.

Table 1: Employee ID Index Table: Created by myself to link together other tables. EmpID is just a whole number list from 1 - 5000.

Table 2: TicketLabourEntries: Column "EmployeeID" is a whole number column and could have duplicates.

Table 3: Users: Column Userid is a whole number list and contains no duplicates.

Fourthsky_0-1659556273805.png

 

I am trying to create a 1:1 relationship from Employee ID Index Table:EmpID -> Users:UserId.

 

The reason is so that I can attach user names to the employee ID's found in TicketLabourEntries table in a visual. TicketLabourEntries has no employee names in the table. Names are in the Users table.

 

I get the following errors:

 

Fourthsky_0-1659556810493.png

 

and this one when I make the direction Both.

 

Fourthsky_1-1659556821594.png

 

Any insight as to what I am doing wrong here would be appreciated.

 

1 ACCEPTED SOLUTION

A few questions then:

1) What is the data source you're using direct query on? If this is direct query against SSAS or a power bi dataset then what you're trying to do won't work. (Can try and explain more if that's the case).

 

2) If the direct query source is plain sql relationsal database then I don't understand the need for the index table? Can you explain?

 

3) How have you created the index table? Eg is it a calculated table or in power query.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

View solution in original post

5 REPLIES 5
KingFedUp
Frequent Visitor

Not many insights on this topic; people are clearly guessing. Why are relationships not more intuitive. Why doesn't Power BI list the problem 'active set of indirect relationships'?

bcdobbs
Super User
Super User

I think it's because of the cardinality. Screen shots show 1:1 but your text suggest there may be duplicate ids in the user table.

 

Manually specifiy it as 1:Many with your user table on the many side. 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

There are no duplicates in the UserId so I think it should be 1:1. Even so I tried 1:* and I get this with both single and both as cross filter directions.

 

Fourthsky_1-1659560279695.png

 

 

Hi @Fourthsky ,

 

In addition to bcdobbs's reply, here I have a test by direct query for Power BI Dataset or AS.

In my sample "Emp ID" and "User" tables are enter tables, and my data model is in Mixed mode.

RicoZhou2_0-1660027863730.png

Here I can create a relationship between "Emp ID" and "User". Please check whether there is a relationship between "TicketLabourEntries" and "User" table in Manage Relationship.

Or you can try to create inactive relationships and then create measures by USERELATIONSHIPS().

If this reply still couldn't help you solve your issue, please share more details about your storage mode, data source and so on.

 

Best Regards.

A few questions then:

1) What is the data source you're using direct query on? If this is direct query against SSAS or a power bi dataset then what you're trying to do won't work. (Can try and explain more if that's the case).

 

2) If the direct query source is plain sql relationsal database then I don't understand the need for the index table? Can you explain?

 

3) How have you created the index table? Eg is it a calculated table or in power query.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.