我想创建从2015年7月1日开始到2017年6月30日结束的会计年度
我现在有了此代码,我已根据给出的会计年度修改了此代码
Cal =
ADDCOLUMNS (
CALENDARAUTO ( 3 ),
"MIndex", MONTH ( EDATE ( [Date], -3 ) ),
"CalMonth", FORMAT ( [Date], "mmm" ),
"CalQtr", "Q"
& CEILING ( MONTH ( [Date] ), 3 ) / 3,
"CalYear", YEAR ( [Date] ),
"FinQtr", "Q"
& CEILING ( MONTH ( EDATE ( [Date], -3 ) ), 3 ) / 3,
"FY",
VAR CY =
RIGHT ( YEAR ( [Date] ), 2 )
VAR NY =
RIGHT ( YEAR ( [Date] ) + 1, 2 )
VAR PY =
RIGHT ( YEAR ( [Date] ) - 1, 2 )
VAR FinYear =
IF ( MONTH ( [Date] ) > 3, CY & "-" & NY, PY & "-" & CY )
RETURN
FinYear,
"FinWeekNo", WEEKNUM ( EDATE ( [Date], -3 ), 2 ),
"CalWeekNo", WEEKNUM ( [Date], 2 ),
"Weekend/Working", IF ( WEEKDAY ( [Date], 2 ) > 5, "Weekend", "Working" ),
"Day", FORMAT ( [Date], "ddd" ),
"CustomDate", FORMAT ( [Date], "d/mm" )
)
现在我如何修改上面的代码
答案 0 :(得分:0)
您使用CALENDARAUTO(3)函数,其中参数将会计年度定义为三月结束。除此之外,它还会查看模型的所有datetime列,并相应地定义日期范围。 如果您想对日期范围进行硬编码,只需更改
CALENDARAUTO(3)
到
CALENDAR("2015-07-01", "2017-06-30")
您也可以将每个列添加为计算列。这将使阅读代码变得容易得多。