我想创建一个专栏,其中包括Current_Week, Previous_Week,and Non
get_CW = //works fine
IF(
AND(
WEEKNUM(TODAY()) = WEEKNUM('Calendar'[Date]),
YEAR(TODAY()) = YEAR('Calendar'[Date])
),
"CW",
"Non"
)
我一直在计算下面的 PW
get_CW_and_PW =
IF(
AND(
WEEKNUM(TODAY()) = WEEKNUM('Calendar'[Date]),
YEAR(TODAY()) = YEAR('Calendar'[Date])
),
"CW",
IF(
/// CW-7 days
),
"PW",
"Non"
)
使用变量: