Forum Discussion

NBDOC's avatar
NBDOC
Frequent Visitor
2 years ago
Solved

Matrix table calculations

My apologies if asking a repeated question. Couldn't find an answer after lots of reading.  I created a matrix table for field table 'Productivity' where rows on the matrix are names of employees fr...
  • NBDOC's avatar
    2 years ago

    had some issues posting the table and matrix but in any case, I finally found the answer:

     
    Field1 % Var =
    var _a = CALCULATE(SUM(Productivity[Field1),FILTER(Master,Master[Date].[Year]=max(Master[Date].[Year])-1))
    var _b = CALCULATE(SUM(Productivity[Field1]),FILTER(Master,Master[Date].[Year]=max(Master[Date].[Year])))
    return
    IF(ISINSCOPE(Master[Date].[Year]),SUM(Productivity[Field1]),FORMAT(DIVIDE(_b-_a,_a),"Percent"))