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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

IF statement between 2 fields from different Data sources

Hi, 

I need to create another column/calculated field - If(id_vendor="UNKN",Rerefence,id_vendor). 

i guess because id_vendor and reference are fields from different data sources, i cant. Do you have any idea how to do this?

 

You can see bellow, how the table looks like. 

Thanks in advance

 

vdichev_0-1611317909372.png

 

2 REPLIES 2
aj1973
Community Champion
Community Champion

Hi @Anonymous 
Normally you are looking for a fourmula like this : 
Column =
var col = CONTAINS(Table1, Table1[id_vendor], "UNKN")
Return
IF(col ,RELATED(Table2[Reference]), id_vendor)
 
However for this formula to work Columns 'Reference' and 'id_vendor' have to be same format(Text)
 
 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Anonymous
Not applicable

Unfortunately, it does not work. i got an error when using this REATED function. can you help please ?

vdichev_0-1611424115492.png

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.