Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculate variance between 2 rows in Matrix

Hello,   I am working on creating a matrix that is visual left to right vs top to bottom.  I am having trouble caluclating the varaince between the rows in the matrix.  My solution worked fine in t...
  • v-yalanwu-msft's avatar
    4 years ago

    Hi, Anonymous ;

    You could create a measure like below:

    Measure = IF(ISINSCOPE('Table'[Year]),SUM([Value]),CALCULATE(SUM([Value]),FILTER('Table',[Year]=2021))-CALCULATE(SUM([Value]),FILTER('Table',[Year]=2020)))

    The final output is shown below:

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.