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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.