Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Handling Stepped Matrix and Displaying values based on Current Stepped Row Level

Hello! I am currently trying to build a matrix visual that would incorporate Hierarchy with a functionality of choosing displayed value based on currently Expanded Row (Expanding/Collapsing change...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

    You can create two measures as below, please find the details in the attachment:

    RAG = 
    VAR _iniselected =
        ISINSCOPE ( 'Table'[Initiative] )
    VAR _proselected =
        ISINSCOPE ( 'Table'[Program] )
    VAR _inirag =
        CALCULATE (
            MAX ( 'Table'[INI.RAG] ),
            ALLEXCEPT ( 'Table', 'Table'[Initiative] )
        )
    VAR _prorag =
        CALCULATE (
            MAX ( 'Table'[PGM.RAG] ),
            ALLEXCEPT ( 'Table', 'Table'[Program] )
        )
    RETURN
        SWITCH ( TRUE (), _proselected, _prorag, _iniselected, _inirag )
    Status = 
    VAR _iniselected =
        ISINSCOPE ( 'Table'[Initiative] )
    VAR _proselected =
        ISINSCOPE ( 'Table'[Program] )
    VAR _inistatus =
        CALCULATE (
            MAX ( 'Table'[INI.Status] ),
            ALLEXCEPT ( 'Table', 'Table'[Initiative] )
        )
    VAR _prostatus =
        CALCULATE (
            MAX ( 'Table'[PGM.Status] ),
            ALLEXCEPT ( 'Table', 'Table'[Program] )
        )
    RETURN
        SWITCH ( TRUE (), _proselected, _prostatus, _iniselected, _inistatus )

    Best Regards