DAX分列年月日
提取年份列:
dax
Expected Collection Year = IF(ISBLANK(OutboundStatus[Expected Collection Date]),BLANK(),YEAR(OutboundStatus[Expected Collection Date]) )
提取月份列:
dax
Expected Collection Month = IF(ISBLANK(OutboundStatus[Expected Collection Date]),BLANK(),MONTH(OutboundStatus[Expected Collection Date]) )
提取日期列:
dax
Expected Collection Day = IF(ISBLANK(OutboundStatus[Expected Collection Date]),BLANK(),DAY(OutboundStatus[Expected Collection Date]) )
yyyy-mm:
Expected Collection YYYY-MM =
IF(
ISBLANK(OutboundStatus[Expected Collection Date]),
BLANK(),
FORMAT(OutboundStatus[Expected Collection Date], "yyyy-mm")
)
Expected Collection Month Name =
IF(
ISBLANK(OutboundStatus[Expected Collection Date]),
BLANK(),
FORMAT(OutboundStatus[Expected Collection Date], "MMMM") // 显示 "January", "February" 等
)
// 或者简写月份
Expected Collection Month Short =
IF(
ISBLANK(OutboundStatus[Expected Collection Date]),
BLANK(),
FORMAT(OutboundStatus[Expected Collection Date], "MMM") // 显示 "Jan", "Feb" 等
)