【发布时间】:2018-10-04 10:38:57
【问题描述】:
在 power bi 的 查询编辑器 中,我需要将一个日期列拆分为另外两列。一个为“当月”,另一个为“不在当月”
对于“在当前月份”我使用了Date.IsInCurrentMonth,现在我需要对于“不在当前月份”
感谢任何帮助。
泰。
【问题讨论】:
标签: powerbi powerquery
在 power bi 的 查询编辑器 中,我需要将一个日期列拆分为另外两列。一个为“当月”,另一个为“不在当月”
对于“在当前月份”我使用了Date.IsInCurrentMonth,现在我需要对于“不在当前月份”
感谢任何帮助。
泰。
【问题讨论】:
标签: powerbi powerquery
只需使用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"
【讨论】:
试试这个对我有用的公式:
if (Date.Month([Order Date]) = Date.Month(DateTime.Date(DateTime.LocalNow())))
then "Current Month"
else "Not Current Month"
【讨论】:
我知道这是一篇旧帖子,我做了一些稍微不同的事情,因为我不想给你 IF 语句。
Logical.ToText(Date.IsInCurrentMonth([PROCESSDATE])) = "false"
【讨论】: