Forum Discussion

railtons's avatar
railtons
Helper I
2 years ago
Solved

Customize the matrix component totals.

I'm working with the matrix component to represent my project tracking information. At the bottom of the component, I enabled the option to show the totals. However, this total is the sum of the fir...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi railtons ,

    You cannot have the Total in the matrix calculate the sum of different types separately and present it in a hierarchy. There is no setting that can achieve this effect.
    And according to your screenshot, there should be fields placed in the rows, columns, and values ​​of your matrix, which means that you cannot add additional measures or columns to the existing matrix to achieve your effect unless you rebuild the entire matrix.
    I suggest you create an additional matrix to show the two sums.
    Here is my sample data:

    Use this DAX to create a measure:

    Total = 
    VAR _Type1 = MAX('Table'[Type1])
    VAR _Type2 = MAX('Table'[Type2])
    RETURN
    CALCULATE(
        SUM('Table'[Value]),
        ALLEXCEPT('Table', 'Table'[Group]),
        'Table'[Type1] = _Type1 && 'Table'[Type2] = _Type2
    )

    Then create the matrix:

     

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