Forum Discussion

ashmitp869's avatar
ashmitp869
Responsive Resident
6 months ago
Solved

Need help in matrix visual .

Hi ,
How to achive this type of in Power BI matrix


PBI matrix used

 


Provided sample file attached ?
https://github.com/suvechha/samplepbi/blob/main/sample_opp.pbix

  • Hi ashmitp869 

     

    You will need to create a display table containing the measure categories and the names as well as the sort columns for those and also a format string column.

    Create this measure

    Display Table Value = 
    VAR _cat =
        SELECTEDVALUE ( DisplayTable[Category] )
    VAR _measure =
        SELECTEDVALUE ( DisplayTable[Measure] )
    VAR _type =
        SELECTEDVALUE ( DisplayTable[Type] )
    VAR _subtotal =
        CALCULATE (
            SWITCH (
                _measure,
                "Qty", [Qty],
                "Value ($)", [Value($)],
                "Weight Value ($)", BLANK () --replace with the actual measure
            ),
            KEEPFILTERS ( DATA[Stage] = _cat )
        )
    VAR _total =
        SWITCH (
            _measure,
            "Qty", [Qty],
            "Value ($)", [Value($)],
            "Weight Value ($)", BLANK ()
        )
    VAR _other =
        SWITCH ( _measure, "Qty %", [Qty Strike Rate], "Value %", [Value Strike Rate] )
    RETURN
        SWITCH ( _type, "TOTAL", _total, "Subtotal", _subtotal, "Other", _other )
    

    Apply dynamic format strings to this measure

    Note: As the measures are materialized using a disconnnected table's column, these measures cannot be sorted individually.

     

    Please see the attached pbix.

2 Replies

  • Hi ashmitp869 

     

    You will need to create a display table containing the measure categories and the names as well as the sort columns for those and also a format string column.

    Create this measure

    Display Table Value = 
    VAR _cat =
        SELECTEDVALUE ( DisplayTable[Category] )
    VAR _measure =
        SELECTEDVALUE ( DisplayTable[Measure] )
    VAR _type =
        SELECTEDVALUE ( DisplayTable[Type] )
    VAR _subtotal =
        CALCULATE (
            SWITCH (
                _measure,
                "Qty", [Qty],
                "Value ($)", [Value($)],
                "Weight Value ($)", BLANK () --replace with the actual measure
            ),
            KEEPFILTERS ( DATA[Stage] = _cat )
        )
    VAR _total =
        SWITCH (
            _measure,
            "Qty", [Qty],
            "Value ($)", [Value($)],
            "Weight Value ($)", BLANK ()
        )
    VAR _other =
        SWITCH ( _measure, "Qty %", [Qty Strike Rate], "Value %", [Value Strike Rate] )
    RETURN
        SWITCH ( _type, "TOTAL", _total, "Subtotal", _subtotal, "Other", _other )
    

    Apply dynamic format strings to this measure

    Note: As the measures are materialized using a disconnnected table's column, these measures cannot be sorted individually.

     

    Please see the attached pbix.