cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EmPi
Frequent Visitor

Wrong releationship of Table values

Hi everybody,

 

I am facing following issue: I have two tables (see below Table A and Table B) and I want to display the relation of the columns FC and Cat. The releation is given over the the column LookUp. The problem is that for every Cat the matrix is showing me the relation to the very first value of the column FC.

Current result

CatFC
ETS_ABAA
ETS_ETKA
ETS_KKKA
ETS_ABAA
ETS_OIIA
ETS_KKJA

 

Expected Result

 

CatFC
ETS_ABAA
ETS_ETKA
ETS_KKKC
ETS_ABAB
ETS_OIIC
ETS_KKJD

 

Table A

CatLookUp
ETS_ABAFID_1
ETS_ETKFID_1
ETS_KKKFID_3
ETS_ABAFID_2
ETS_OIIFID_3
ETS_KKJFID_4

 

Table B

LookUp AFC
FID_1A
FID_1A
FID_3C
FID_2B
FID_3C
FID_4D

 

 

 

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@EmPi 

Select Table A and Merge with Table B on Lookup Column.
Modify the code, including the Table. Distinct around #"Table B"

= Table.NestedJoin(Source, {"LookUp"}, Table.Distinct(#"Table B"), {"LookUp A"}, "Table B", JoinKind.LeftOuter)

 
Expand the new merged column on FC

Fowmy_0-1600513120185.png

Result

Fowmy_1-1600513164179.png

 

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@EmPi 

Select Table A and Merge with Table B on Lookup Column.
Modify the code, including the Table. Distinct around #"Table B"

= Table.NestedJoin(Source, {"LookUp"}, Table.Distinct(#"Table B"), {"LookUp A"}, "Table B", JoinKind.LeftOuter)

 
Expand the new merged column on FC

Fowmy_0-1600513120185.png

Result

Fowmy_1-1600513164179.png

 

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@EmPi 

 

Well, in modeling, you cannot create many-to-one relationship if the one side has unique values, If you arrange your table in that way, you do the modilng 

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

Power BI Dev Camp Session 22 with aka link 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!