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
TaufikMaggangka
Helper II
Helper II

Relationship in direct query mode

Dear All, I need help about relationship in direct query mode. Basically, I have two table. Here my illustration of my issue.

Table 1.

IDID StudentName StudentCovidSymptoms
11111AFever
22222BCough
33333CLoss of smell
44444DFatigue
55555EFever

 

Table 2.

IDScreenerIDID StudentAntigenResult
122222Positive
255555Negative
333333Not Tested

 

I Try to create relationship between " ID" in table 1 and "ScreenerID" in table 2 because the value have same unique value. I create "one to one" Cardinality" and cross filter direction "Both"(Note: Sigle cannot be apply). But the result I got is messy, Here my result when I try to create a table visual:

ID StudentName StudentCovidSymptomsAntigen Result
1111AFever 
1111AFeverPositive
1111AFeverNegative
1111AFeverNot Tested
2222BCough 
2222BCoughPositive
2222BCoughNegative
2222BCoughNot Tested
3333CLoss of Smell 
3333CLoss of SmellPositive
3333CLoss of SmellNegative
3333CLoss of SmellNot Tested
4444DFatigue 
4444DFatiguePositive
4444DFatigueNegative
4444DFatigueNot Tested
5555EFever 
5555EFeverPositive
5555EFeverNegative
5555EFeverNot Tested


Basically, Every ID have 4 value even ID that not consist in the table 2.

I Hope ther result will be like this :

ID StudentName StudentCovidSymptomsAntigen Result
1111AFever 
2222BCoughPositive
3333CLoss of SmellNot Tested
4444DFatigue 
5555EFeverNegative


Anyone can help, I am new with power bi :). Anyhelp will be really appreaciated.

Thanks.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@TaufikMaggangka , Make it one to Many and bi-directional and try. Or you need to have a common table for

ID ID Student Name

 

And use that. 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

This requires a Join and not relationship.

 

In Power Query Do a LeftJoin:

Table 1 LeftJoin Table2

 

Also, if you can explain a bit more on unique columns in both the tables, it would be helpful.

 

Hi @Anonymous ,

Unique values is ID on this case. the unique value have same value for each data registered. 

Basically, we have 2 form to input the data on the database. the first form is about screener table, the purpose of this table to screen student which have covid symptoms. the ID is unique value that fill automatically. the second form is to submit antigen result for each student that have screen. the id on the first table and second table have same unique value. it is why I thought it can be done with relationship.

Any more explananation about left join table on my cases will be really appreciate. I am not resolve this issue yet.

amitchandak
Super User
Super User

@TaufikMaggangka , Make it one to Many and bi-directional and try. Or you need to have a common table for

ID ID Student Name

 

And use that. 

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.

Top Solution Authors