Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Different Calculation for Different Row Levels in Matrix Visual

Hi all,   Below is a simplified example of the table that I have and the result that I got.     What I'm trying to do is, instead of adding the Actual values of all Measures in one sto...
  • TomMartens's avatar
    TomMartens
    3 years ago

    Hey Anonymous ,

    maybe this measure: provides what you are looking for:

    Measure 2 = 
    var isinScopeStore = ISINSCOPE('new 18'[STORE] )
    return
    IF( isinScopeStore
        , CALCULATE( SUM('new 18'[ACTUAL] ) )
        , COUNTROWS(
            FILTER(
                ADDCOLUMNS(
                    VALUES( 'new 18'[STORE] )
                , "noOfYes" , CALCULATE( SUM( 'new 18'[ACTUAL] ) )
                )
                , [noOfYes] = 3
            )
        )
    )

    The result based on your sample data:

    Hopefully, this provides what you are looking for.

    Regards,
    Tom