Forum Discussion

DimaMD's avatar
DimaMD
Icon for Solution Sage rankSolution Sage
2 years ago
Solved

Hierarchy in the table matrix

Hello community, I haven't asked for help in a long time, but I faced such a problem I have several measures that I want to group in a matrix visualization. For the hierarchy, I created a simple ta...
  • v-weiyan1-msft's avatar
    2 years ago

    Hi DimaMD ,

     

    Based on your additional description, please try code as below.

    MEASURE = 
    VAR _P1 =
        SELECTEDVALUE ( Table1[P1] )
    VAR _P2 =
        SELECTEDVALUE ( Table1[P2] )
    RETURN
        IF (
            ISINSCOPE ( 'Table1'[P2] ),
            SWITCH (
                _P2,
                "R_Cashless", [R_Cashless],
                "R_Cash", [R_Cash],
                "P_Cashless", [P_Cashless],
                "P_Cash", [P_Cash],
                "Stock balance", [Stock balance]
            ),
            SWITCH (
                _P1,
                "Stock balance", [Stock balance],
                "Receivables", [Receivables],
                "Payables", [Payables]
            )
        )
    

    Result is as below.

    Hope that works for you.


    Best Regards,
    Yulia Yan


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.