Power BI。删除重复项,但保留空值

时间:2018-11-15 08:04:28

标签: powerbi dax powerquery m

在Power BI中,我需要删除列的重复项,但保留空值,因为它们是“待定”的。有什么办法可以使用DAX或查询编辑器吗?

2 个答案:

答案 0 :(得分:3)

以两种方式过滤表,没有空值,只有空值。

在没有空值的表上,删除重复项。 public function store(Request $request) { $this->validate($request, [ 'email' => [ 'required', 'email', function ($attribute, $value, $fail) { if (Users::whereEmail($value)->whereActive(0)->count() > 0) { $fail($attribute.' is already used.'); } }, ]); } }

将空行添加到此表中。

M代码如下:

Home > Remove Rows > Remove Duplicates

答案 1 :(得分:1)

在查询编辑器中尝试一下。

  1. 添加索引列(“添加列”标签>索引列)
  2. 使用此公式添加自定义列([Test]是您的原始列,其中包含null和重复项。

enter image description here

  1. 右键单击最新列[Temp],然后选择Remove Duplicates
  2. 删除[索引]和[临时]列