Forum Discussion
Anonymous
7 years agoNot applicable
Variance between two measures
I have a set of data with a Year-Week column. I want to create a couple of measures for This Year QUS and Last Year QUS so I can see the year on year variance. So effectively it will show Year-Week...
- 7 years ago
Hi Anonymous
You may create the Year column and Week column. Then you may get the last year QUS as below.
LastYearQUS = CALCULATE ( [QUS], FILTER ( ALL ( Table ), Table[Year] = SELECTEDVALUE ( Table[Year] ) - 1 && Table[Week] = SELECTEDVALUE ( Table[Week] ) ) )Regards,
Cherie
v-cherch-msft
7 years agoMicrosoft Employee
Hi Anonymous
You may create the Year column and Week column. Then you may get the last year QUS as below.
LastYearQUS =
CALCULATE (
[QUS],
FILTER (
ALL ( Table ),
Table[Year]
= SELECTEDVALUE ( Table[Year] ) - 1
&& Table[Week] = SELECTEDVALUE ( Table[Week] )
)
)
Regards,
Cherie
- Anonymous7 years agoNot applicableIf I was to turn this into a matrix and add a column to the table how can I do this? Because we are using the ALL function is it just giving a total in all columns rather than filtering it
- Anonymous7 years agoNot applicablev-cherch-msft How do I remove the ALL function as this is hindering my filtering?
- v-cherch-msft7 years agoMicrosoft Employee
Hi Anonymous
I would suggest you create a new thread on forum so that more community members can see it and provide advice. Please remember to post dummy data and desired result.
Regards,
Cherie