Forum Discussion
RodrigoZD
6 years agoFrequent Visitor
YOY week number
I would like to calculate a difference in averages if certain conditions are met: In this particular example, my data looks something like this: Then, when I group it by average of c...
- 6 years ago
For those of you who could have the same question, I found a solution creating a measure like this:
DeltaTest = CALCULATE(AVERAGE(Table[Ratio]), FILTER( ALL(Table), Table[WeekNumber] = SELECTEDVALUE(Table[WeekNumber]) && Table[Year] = SELECTEDVALUE(Table[Year])-1) )and then just another measure that substract
Delta = Table[Ratio] - DeltaTest
RodrigoZD
6 years agoFrequent Visitor
For those of you who could have the same question, I found a solution creating a measure like this:
DeltaTest =
CALCULATE(AVERAGE(Table[Ratio]),
FILTER(
ALL(Table),
Table[WeekNumber] = SELECTEDVALUE(Table[WeekNumber]) && Table[Year] = SELECTEDVALUE(Table[Year])-1)
)and then just another measure that substract
Delta = Table[Ratio] - DeltaTest