Forum Discussion

dzuurman's avatar
dzuurman
Icon for Helper I rankHelper I
5 years ago
Solved

% difference between columns in matrix table

I have a matrix table, in which users can specify which years they want to compare the months of. Say in this case 2019 vs 2020 Of course having the totals of those months show up is easy enough. Bu...
  • v-kelly-msft's avatar
    5 years ago

    Hi dzuurman ,

     

    Suppose your table is like below:

    Create a measure as below:

    Measure = IF(ISINSCOPE('Table'[Year]),SUM('Table'[Amount]),
    var _2019=CALCULATE(SUM('Table'[Amount]),FILTER('Table','Table'[Year]=2019))
    var _2020=CALCULATE(SUM('Table'[Amount]),FILTER('Table','Table'[Year]=2020))
    Return
    _2020-_2019)

    And you will see:

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!