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
calou_33
New Member

Multiple column with foreign key

Hello,

 

I have a table A like this

 

IDField0Field1FIeld2Field 3
1tt111
2xx222
3cc121
4dd221
5yy111
6aa111

 

Table B as :

IDDesc
1YES
2NO

 

 

In Power BI how can i do to have a result like this :

IDField0Field1FIeld2Field 3
1ttYESYESYES
2xxNONONO
3ccYESNOYES
4ddNONOYES
5yyYESYESYES
6aaYESYES

YES

 I cannot make multiple relation

 

Thank for help

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @calou_33,

 

You could have a try with the formulas below.

 

Column1 = LOOKUPVALUE('TableB'[Desc],TableB[ID],'TableA'[Field1])
Column2 = LOOKUPVALUE('TableB'[Desc],TableB[ID],'TableA'[FIeld2])
Column3 = LOOKUPVALUE('TableB'[Desc],TableB[ID],'TableA'[Field 3])

Here is the result.

 

lookupvalue.PNG

 

Hope this can help you!

 

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @calou_33,

 

You could have a try with the formulas below.

 

Column1 = LOOKUPVALUE('TableB'[Desc],TableB[ID],'TableA'[Field1])
Column2 = LOOKUPVALUE('TableB'[Desc],TableB[ID],'TableA'[FIeld2])
Column3 = LOOKUPVALUE('TableB'[Desc],TableB[ID],'TableA'[Field 3])

Here is the result.

 

lookupvalue.PNG

 

Hope this can help you!

 

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Replace your Field1,2,3 columns with the below formulas.

 

Filed1_New = IF(TableA[Filed1]=RELATED(TableB[ID]), RELATED(TableB[Desc]))

Filed2_New = IF(TableA[Filed2]=RELATED(TableB[ID]), RELATED(TableB[Desc]))

Filed3_New = IF(TableA[Filed3]=RELATED(TableB[ID]), RELATED(TableB[Desc]))

 

 

Thanks

Raj

 

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.