Forum Discussion

Gheb_Gabriela's avatar
Gheb_Gabriela
Frequent Visitor
4 years ago
Solved

MEASURE for totals from matrix

Hi all,   I have a question : is there any options to use totals from a matrix to calculate a difference? I want to use the totals from matrix, to make a difference between years. So, in the examp...
  • MFelix's avatar
    4 years ago

    Hi Gheb_Gabriela ,

     

    For this you need to redo the formula you use for the matrix values. I have used the following data for example:

     

    Now add the following measure to your dataset:

    Adjusted Value =
    IF (
        HASONEVALUE ( 'Table'[Cat] ),
        SUM ( 'Table'[Value] ),
        SUM ( 'Table'[Value] )
            - CALCULATE (
                SUM ( 'Table'[Value] ),
                FILTER (
                    ALL ( 'Table'[Year], 'Table'[Quarter], 'Table'[Time] ),
                    'Table'[Year]
                        = SELECTEDVALUE ( 'Table'[Year] ) - 1
                        && 'Table'[Quarter] = SELECTEDVALUE ( 'Table'[Quarter] )
                )
            )
    )

     

     

    Check PBIX file attach.