0
votes

Below are the data set tables. I want to have a calculated column. both the tables are direct query tables in power BI

Table 1 :
Material
1234
1235
1236
1237

Table 2 :
Material
2234
2235
1234
1235

output expected

Table 1 :
Material Calculated Column
1234 1234
1235 1235
1236 No
1237 No
calculated column which will compare both the Material and return Material or "No" in table1 . i have tired related function but I did not get any luck.

1
Can you show how you tried the related function and what error or result you got?Saaru Lindestøkke

1 Answers

0
votes

Does your Table 2 contain unique values? If it does, you can try this formula as a calculated column. The logic behind is to find each matching value, when it doesn't retrieves a "No". The values that the formula find has to be converted to string to be in the same column with "No".

Result = 

var _lookup = LOOKUPVALUE('Table 2'[Value],'Table 2'[Value],[Value])

return if(ISBLANK(_lookup),"No",format(_lookup,"0"))