使用 M 检查另一个值是否存在 table (Power BI)
Using M to check if a value exists in another table (Power BI)
我有2张桌子,
Table 1
Column1
Alex
Barry
Chris
Column1
Name
Miranda
Fanta
Barry
我想删除 Table 1 中出现在查询编辑器 Table 2 中的所有行
为此,我需要在 Table1 中创建一个名为 IsPresent 的列。
Column1 IsPresent
Alex No
Barry Yes
Chris No
如何使用 M 创建此 IsPresent 列?甚至可能吗,如果不是为什么?
你当然可以为此写一个自定义专栏
if List.Contains(Column1[Name], [Column1]) then "Yes" else "No"
但是,如果您的目标只是“删除 Table 1 中出现在 Table 2 中的任何行”,那么您可以执行 left anti join 而不是定义自定义列和过滤。
我有2张桌子,
Table 1
Column1
Alex
Barry
Chris
Column1
Name
Miranda
Fanta
Barry
我想删除 Table 1 中出现在查询编辑器 Table 2 中的所有行
为此,我需要在 Table1 中创建一个名为 IsPresent 的列。
Column1 IsPresent
Alex No
Barry Yes
Chris No
如何使用 M 创建此 IsPresent 列?甚至可能吗,如果不是为什么?
你当然可以为此写一个自定义专栏
if List.Contains(Column1[Name], [Column1]) then "Yes" else "No"
但是,如果您的目标只是“删除 Table 1 中出现在 Table 2 中的任何行”,那么您可以执行 left anti join 而不是定义自定义列和过滤。