Forum Discussion

Dalen's avatar
Dalen
Frequent Visitor
7 years ago
Solved

Meassures in Matrix

Hej!

I have a question of how we can show some running values in a matrix visual.

I have the following Matrix, and would like to show the change from previous year instead. Ex. if I take the Row for START_FY = 2017 i like to show 100% on 2017 and then the change for year 2018 and 2019.

  • Hi Dalen 

    You may try below measure.

    Value_1 =
    VAR min_year =
        CALCULATE ( MIN ( Table2[Start_FY_Column] ), ALL ( Table2[Start_FY_Column] ) )
    VAR min_year_value =
        CALCULATE (
            SUM ( Table2[Value] ),
            FILTER ( ALL ( Table2[Start_FY_Column] ), Table2[Start_FY_Column] = min_year )
        )
    RETURN
        IF (
            MAX ( Table2[Start_FY_Row] ) = MAX ( Table2[Start_FY_Column] ),
            SUM ( Table2[Value] ),
            SUM ( Table2[Value] ) - min_year_value
        )
    

    Regards,

2 Replies

  • Hi Dalen ,

     

    When you use a measure within a matrix or a table visual since measures are calculated taking into account the context you will get the result of the measure and not a different one.

     

    To achieve the purpose you want you need to change your measure to something like this:

    Measure = IF( HASONEVALUE(Table_Start_FY), MEASURE, MEASURE2)

    This is just the general syntax, can you share some sample data, calculation of the measure and the expected result so I can help you in adjusting the formula to your needs.

     

    Regards,

    MFelix

  • v-cherch-msft's avatar
    v-cherch-msft
    Microsoft Employee

    Hi Dalen 

    You may try below measure.

    Value_1 =
    VAR min_year =
        CALCULATE ( MIN ( Table2[Start_FY_Column] ), ALL ( Table2[Start_FY_Column] ) )
    VAR min_year_value =
        CALCULATE (
            SUM ( Table2[Value] ),
            FILTER ( ALL ( Table2[Start_FY_Column] ), Table2[Start_FY_Column] = min_year )
        )
    RETURN
        IF (
            MAX ( Table2[Start_FY_Row] ) = MAX ( Table2[Start_FY_Column] ),
            SUM ( Table2[Value] ),
            SUM ( Table2[Value] ) - min_year_value
        )
    

    Regards,