考虑到周涉及到跨年问题,于是引进WeekDay星期几来设置日期的范围
首先是本周费用:
Cost_Week = VAR CurYearWeek = SELECTEDVALUE('DIM_Date'[YearWeek])
VAR MonDay=CALCULATE(MAX('DIM_Date'[DATE]),FILTER(
ALL('DIM_Date'),'DIM_Date'[YearWeek]<=CurYearWeek),DIM_Date'[WeekDay]=1
考虑到周涉及到跨年问题,于是引进WeekDay星期几来设置日期的范围
首先是本周费用:
Cost_Week = VAR CurYearWeek = SELECTEDVALUE('DIM_Date'[YearWeek])
VAR MonDay=CALCULATE(MAX('DIM_Date'[DATE]),FILTER(
ALL('DIM_Date'),'DIM_Date'[YearWeek]<=CurYearWeek),DIM_Date'[WeekDay]=1