Forum Discussion
Measure rendering as blank in Calculate
- 4 years ago
Found the issue, the measure should be:
Count of Claims Previous Week_1:= VAR CurrentWeek = SELECTEDVALUE('Claim_LastUpdate'[WeekOfYear]) VAR CurrentYear = SELECTEDVALUE('Claim_LastUpdate'[Year]) VAR MaxWeekNumber = CALCULATE(MAX('Claim_LastUpdate'[WeekOfYear]),ALL(Claim_LastUpdate),'Claim_LastUpdate'[Year]=CurrentYear-1) VAR BeginPrevWeekValue= CALCULATE(MIN('Claim_LastUpdate'[FirstofWeek]),ALL(Claim_LastUpdate), 'Claim_LastUpdate'[WeekOfYear] = (CurrentWeek -1) && Claim_LastUpdate[Year] = CurrentYear ) VAR EndPrevWeekValue= CALCULATE(MAX('Claim_LastUpdate'[LastofWeek]),ALL(Claim_LastUpdate), 'Claim_LastUpdate'[WeekOfYear] = (CurrentWeek -1) && Claim_LastUpdate[Year] = CurrentYear ) var result = IF(CurrentWeek <> 2, CALCULATE('Claim_Measures'[Count of Claims],FILTER(ALL(Claim_LastUpdate),IF(CurrentWeek=1,Claim_LastUpdate[WeekOfYear]=MaxWeekNumber && Claim_LastUpdate[Year]=CurrentYear-1,Claim_LastUpdate[WeekOfYear] = CurrentWeek - 1 && Claim_LastUpdate[Year]=CurrentYear) ) ), IF(CurrentWeek= 2, CALCULATE('Claim_Measures'[Count of Claims],ALL(Claim_LastUpdate),Claim_LastUpdate[FirstOfWeek]=BeginPrevWeekValue && Claim_LastUpdate[LastOfWeek]=EndPrevWeekValue && Claim_LastUpdate[Year] = CurrentYear && 'Claim_LastUpdate'[WeekOfYear] = (CurrentWeek -1) )) ) return result
Found the issue, the measure should be:
Count of Claims Previous Week_1:= VAR CurrentWeek = SELECTEDVALUE('Claim_LastUpdate'[WeekOfYear]) VAR CurrentYear = SELECTEDVALUE('Claim_LastUpdate'[Year]) VAR MaxWeekNumber = CALCULATE(MAX('Claim_LastUpdate'[WeekOfYear]),ALL(Claim_LastUpdate),'Claim_LastUpdate'[Year]=CurrentYear-1) VAR BeginPrevWeekValue= CALCULATE(MIN('Claim_LastUpdate'[FirstofWeek]),ALL(Claim_LastUpdate), 'Claim_LastUpdate'[WeekOfYear] = (CurrentWeek -1) && Claim_LastUpdate[Year] = CurrentYear ) VAR EndPrevWeekValue= CALCULATE(MAX('Claim_LastUpdate'[LastofWeek]),ALL(Claim_LastUpdate), 'Claim_LastUpdate'[WeekOfYear] = (CurrentWeek -1) && Claim_LastUpdate[Year] = CurrentYear ) var result = IF(CurrentWeek <> 2, CALCULATE('Claim_Measures'[Count of Claims],FILTER(ALL(Claim_LastUpdate),IF(CurrentWeek=1,Claim_LastUpdate[WeekOfYear]=MaxWeekNumber && Claim_LastUpdate[Year]=CurrentYear-1,Claim_LastUpdate[WeekOfYear] = CurrentWeek - 1 && Claim_LastUpdate[Year]=CurrentYear) ) ), IF(CurrentWeek= 2, CALCULATE('Claim_Measures'[Count of Claims],ALL(Claim_LastUpdate),Claim_LastUpdate[FirstOfWeek]=BeginPrevWeekValue && Claim_LastUpdate[LastOfWeek]=EndPrevWeekValue && Claim_LastUpdate[Year] = CurrentYear && 'Claim_LastUpdate'[WeekOfYear] = (CurrentWeek -1) )) ) return result