使用功能查询

时间:2018-10-04 10:38:58

标签: powerbi powerquery

在Power Bi的查询编辑器中,我需要将日期列拆分为另外两列。一个为“当前月份” ,另一个为“不在当前月份”

对于“当月” ,我使用了Date.IsInCurrentMonth,现在我需要对“当月未使用”

感谢您的帮助。
是的

3 个答案:

答案 0 :(得分:2)

只需使用not

if not Date.IsInCurrentMonth([Date])
then "Not in Current Month"
else "In Current Month"

反之亦然

if Date.IsInCurrentMonth([Date])
then "In Current Month"
else "Not in Current Month"

答案 1 :(得分:0)

尝试这个对我有用的公式:

if (Date.Month([Order Date]) = Date.Month(DateTime.Date(DateTime.LocalNow())))
then "Current Month"
else "Not Current Month"

答案 2 :(得分:0)

我知道这是一篇过时的文章,我做了一些稍有不同的事情,因为我不想让您使用IF语句。

Logical.ToText(Date.IsInCurrentMonth([PROCESSDATE])) = "false"