在Excel Power Query中将负值替换为null



我有一个计算列减去两个日期,但有时会得到一个负数。我仍然想保留这些行,但我想用空值替换任何负数的实例。我使用查询在枢轴中进行测量,并且否定在枢轴中产生错误。

当前列为[date1]-[date2]。

我试过我知道的所有公式,但它们在DAX中不起作用。

您可以使用自定义列。

Custom1

if [date1]>[date2] then [date1]-[date2] else null

Custom2

if [custom1] <0 then null else [custom1]

删除原列&Custom1

重命名Custom2为原列名

最新更新