Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

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...
  • v-cherch-msft's avatar
    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