Power BI里日期表的一种参考写法
日期表 = ADDCOLUMNS (
CALENDAR ( date(2016,1,1),TODAY()),
"年", YEAR ( [Date] ),
"季度", ROUNDUP( MONTH ( [Date] )/3,0 ),
"月", MONTH ( [Date] ),
"周", WEEKNUM([Date]),
"年季度", YEAR ( [Date] ) & "Q" & ROUNDUP( MONTH ( [Date] )/3,0 ) ,
"年月", YEAR ( [Date] ) * 100 + MONTH ( [Date] ),
"年周", YEAR ( [Date] ) * 100 + WEEKNUM ( [Date] ),
"星期几", WEEKDAY([Date])
)
网友评论