Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Week Over Week doesn't work when Filters are used

I have written a Week Over Week Percentage Calculation measure to find the tickets trend. The formula does not work when I add a filter to find out Week Over Week trend for the selected groups.

 

Total Count = DISTINCTCOUNT(incident[number])
New Calculation LW =
VAR CurrentWeek = SELECTEDVALUE( incident[WeekNumber] )
VAR CurrentYear = SELECTEDVALUE( incident[opened_date].[Year] )
VAR MaxWeekNumber = CALCULATE( MAX(incident[WeekNumber] ), ALL(incident) )
RETURN
SUMX(
FILTER( ALL(incident),
IF( CurrentWeek = 1,
incident[WeekNumber] = MaxWeekNumber && incident[opened_date].[Year] = CurrentYear - 1,
incident[WeekNumber] = CurrentWeek - 1 && incident[opened_date].[Year] = CurrentYear ) ),
[Total Count] )
Percentage WOW =
VAR lastWeekAmount =
CALCULATE (
COUNT( incident[number] ),
FILTER (
ALL ( 'incident' ),
'incident'[WeekNumber]
= MIN ( 'incident'[WeekNumber] ) - 1
)
)
RETURN
DIVIDE ( COUNT( incident[number] ) - lastWeekAmount, lastWeekAmount, 0 )

Before Adding the Filter - the percentage is accurate

 

After Adding a Group as Filter --- Ex Group --- Group1, Group2, Group3

After Adding filter

 

After adding the filter the measure New Calculation LW doesn't change and it still shows the values of all the groups.

1 Reply

  • Can you remove all from

    ALL(incident)

     

    Just make it

    incident

    Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
    Thanks.