PowerBI - 来自另一个 table 的匹配值

PowerBI - Match Value from another table

我有两个表,它们通过 Table1[ColA] &Table1[ColB].

连接

现在我尝试将 Table1[ColB] 中的值与 Table2[ColB] & return 匹配结果在表 2[ColC] 中。 结果应该是 -

if it matches "Found"
doesn't match "Not-Found"
else Empty

表 1

ColA    ColB   ColC 
11        AA
12        BB
13        

表 2

ColA    ColB
11        DD
12        CC
13        BB

预期输出 表 1

ColA    ColB   ColC 
11        AA   Not-Found
12        BB   Found
13        CC   Empty

有谁知道这个问题的解决方法!!

这些表是否相关?然后你可以做下面的列公式:

ColC = IF(ISBLANK(related(Table2[ColB]), "Not-Found", IF(Table1[ColB] = related(Table2[ColB]), "Found", "Empty"))

我会在 Table 1.

中使用这样的计算列来执行此操作
Col_C = 
         Var out1 = LOOKUPVALUE(Table2[ColB],Table2[ColB],Table1[ColB])
         Var out2 = IF(out1 = "", "Not Found","Found")
         Var out3 = if(Table1[ColB] = "", "Empty", out2)
return out3

The Key is to use Use the LOOKUPVALUE function to see, if the value exists.

回答如果对您的问题有帮助,请采纳