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.
Dear All, I need help about relationship in direct query mode. Basically, I have two table. Here my illustration of my issue.
Table 1.
ID | ID Student | Name Student | CovidSymptoms |
1 | 1111 | A | Fever |
2 | 2222 | B | Cough |
3 | 3333 | C | Loss of smell |
4 | 4444 | D | Fatigue |
5 | 5555 | E | Fever |
Table 2.
ID | ScreenerID | ID Student | AntigenResult |
1 | 2 | 2222 | Positive |
2 | 5 | 5555 | Negative |
3 | 3 | 3333 | Not 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 Student | Name Student | CovidSymptoms | Antigen Result |
1111 | A | Fever | |
1111 | A | Fever | Positive |
1111 | A | Fever | Negative |
1111 | A | Fever | Not Tested |
2222 | B | Cough | |
2222 | B | Cough | Positive |
2222 | B | Cough | Negative |
2222 | B | Cough | Not Tested |
3333 | C | Loss of Smell | |
3333 | C | Loss of Smell | Positive |
3333 | C | Loss of Smell | Negative |
3333 | C | Loss of Smell | Not Tested |
4444 | D | Fatigue | |
4444 | D | Fatigue | Positive |
4444 | D | Fatigue | Negative |
4444 | D | Fatigue | Not Tested |
5555 | E | Fever | |
5555 | E | Fever | Positive |
5555 | E | Fever | Negative |
5555 | E | Fever | Not 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 Student | Name Student | CovidSymptoms | Antigen Result |
1111 | A | Fever | |
2222 | B | Cough | Positive |
3333 | C | Loss of Smell | Not Tested |
4444 | D | Fatigue | |
5555 | E | Fever | Negative |
Anyone can help, I am new with power bi :). Anyhelp will be really appreaciated.
Thanks.
Solved! Go to Solution.
@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.
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.
@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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
43 | |
23 | |
21 | |
15 | |
15 |
User | Count |
---|---|
45 | |
31 | |
30 | |
18 | |
17 |